Skip to main content
MahiDev — Learn. Build. Become AI-ready.

Module 14

Modules and Packages

Learn how to organize Python code into modules and packages.

Intermediate5 hours10 lessons

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.

Intermediate25 min

02

Building Custom Python Modules — Visual & Relatable

Learn how to create your own .py files, organize reusable code, and understand what __pycache__ really does.

Intermediate35 min

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.

Intermediate40 min

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.

Intermediate35 min

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.

Intermediate25 min

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.

Intermediate45 min

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.

Intermediate35 min

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.

Intermediate40 min

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.

Intermediate35 min

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.

Intermediate40 min