Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
Python Modules and Packages: An Introduction (Summary)
The next video let you explore the module search path. Where will your computer look for the modules you’re importing? The
import statement was next, and all the different forms that it can take.
After that, you got to practice executing a module as a script, and you learned about the attribute
__name__. Then you learned if you import a module a second time, it doesn’t reload the contents inside of it, so you’d have to quit the interpreter and restart it, but you also saw that there is a tool in the
importlib module that you can import called
reload(). As a project grows, it starts to make sense to look at organizing multiple modules into a package, in that sort of directory structure.
The next video was all about wildcard importing and the ways that you can set up your module or packages to set up your user for success if a user is going to use the wildcard (
*) when they’re importing.
01:55 As the project may grow and the amount of modules that you have increases, it may make sense to break up the package into subpackages, and how that affects your namespaces. And finally, there was this conclusion and course review.
Become a Member to join the conversation.