Programming Bootcamp for Scientists #27
- 00:00 The Modules chapter
- 00:30 Goals of having modules
- 04:00 Before modules (a function in a single-file program)
- 04:34 Creating modules: Separating the above program in to module and executable. (import, from)
- 05:40 How does Python find the module to be loaded?
- 07:56 Importing and aliasing module name (as)
- 11:25 path to load modules from - the module search path
- 12:30 sys.path the module search path
- 13:45 Flat project directory structure
- 14:39 Relative paths (Why is the directory called 'bin'?
- 16:30 Absolute path and why it is not a good practice
- 18:45 Back to the relative path and explaining how it works (os.path.join, os.path.abspath, os.path.dirname, __file__)
- 24:13 Mentioning modules in directory hierarchy (submodules) but not showing them. Since then, there is already a slide with that example.
- 24:46 Python modules are compiles .pyc files, __pycache__ directory.
- 28:30 Caching
- 30:40 How "import" and "from" work?
- 31:20 Runtime loading of modules
- 33:30 When you import a module, will Python find it eventually?
- 35:13 Conditional loading of modules
- 37:18 Duplicate importing of functions (pylint)
- 40:50 Script or library (script or module) (__name__, __main__)
- 47:00 Import the same module multiple times
- 48:14 Exercises: Convert the earlier solutions to be modules and programs.
Published on 2022-10-23
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post