Module 14
Modules and Packages
Learn how to organize Python code into modules and packages.
01
Modules in Python — Visual & Easy to Understand
Understand why modules exist, how import works, and the difference between built-in and custom modules — with a toolbox analogy.
02
Building Custom Python Modules — Visual & Relatable
Learn how to create your own .py files, organize reusable code, and understand what __pycache__ really does.
03
Python import Statement — 4 Syntaxes Made Easy
Master all 4 import syntaxes with phone-app visuals, aliases, module.name access, and runnable examples using bankinfo, arithops, and mathconstants.
04
from … import in Python — Direct Access and Aliases
Learn 3 from-import syntaxes with a toolbox memory trick: import the whole box vs pick specific tools. Named imports, aliases, and when to avoid import star.
05
Reloading Python Modules with importlib.reload()
Understand when reload is needed using a portfolio and Netflix analogy — importlib.reload() picks up file changes while a program is still running.
06
Multi-Module Python Project — Calculator Case Study
Build a real 3-file Python calculator — calc_menu.py for UI, calcops.py for logic, main.py as controller. The pattern used in professional projects.
07
Python Packages Overview — Function, Module & Package
Understand the reuse ladder from functions to modules to packages — and when to use each level in real Python projects.
08
Creating Python Packages — Folder, __init__.py, and Modules
Learn how to build your own package using a folder, __init__.py, and multiple modules — with a complete bankkit example.
09
Reusing Python Packages — sys.path.append and PYTHONPATH
Import packages from any folder using sys.path.append for one script or PYTHONPATH for machine-wide reuse — with bankkit examples.
10
PYTHONPATH Global Setup — Windows, macOS & Linux
Set PYTHONPATH permanently on Windows, macOS Intel, Apple Silicon, and Linux so your packages import from any project without sys.path.append.