Modules and Packages | Python for Beginners [33 of 44]

preview_player
Показать описание


#microsoftdeveloper #pythonforbeginners #learntocode
Рекомендации по теме
Комментарии
Автор

"The best code in the world is the code that is already written." :)

zealotbr
Автор

At 05:00, it's worth noting that you can get conflicts with 2 namespaces if they happen to have the same name for some function. Lets say namespace helpers has display() and another namespace also has display(), you can get confused during coding. (I'm coming from a C# background and it happens there if you're working with lots of code, currently learning Python). I prefer the first variant of importing.

Edit: Oh you mention this later in the video, nevermind :P

David-Codes
Автор

A noobs question:
If we are importing always the latest version, how can we ensure that, in the latest version, somebody ill-intentionned did not introduce some dangerous piece of code ?

What are the securities in place ?

Skrattoune
Автор

class 32, it is missing the else: statement is wrong
it is missing
else:

gustavow
Автор

I did not got it yet... How can we create our own module? I've def display and done as he done... But when I called helpers it gave me an error massage that helpers is not Can any body help me please 🙏

fatimayounis
Автор

I have a problem, the word helpers is not defined although I use python 3

mecabaseta
Автор

So in other words, a module is a script?

ohogue
Автор

Don't know why but my comment have been lost so here we go again.
I read some comments and, for me, I did get the results as in the video for the helpers and def part.
Works great.
For me it is about the venv part that it didn't work.
I went to PowerShell under my code editor and entered : pip install virtualenv and clicked Enter.
First line tells me : Defaulting to user installation because normal site-packages is not writeable.
Weard.
Then it is Collecting and Downloading many files and at the end, it installed them.
Then it say : WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\program files\python39\python.exe -m pip install --upgrade pip' command.
Just to tell you, if you are in a cmd environment, it's ok.
If you are under your code in the Terminal, you need to put program files between " " as "program files".
PowerShell doesn't like spaces in folder names.
Message : "The term 'c:\program' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again."

My problem is now the Activate.ps1 that doesn't work.
From : ./venv/Scripts/Activate.ps1
I get : cannot be loaded because running scripts is disabled on this system

+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Need help on that one.
Thanks guys.

ghyslainhubert