Modules, Packages and Projects
Split code across files, import it, organise it into packages, tour the standard library, and learn the tools and layout of a real, shippable Python project.
Until now your programs lived in one file. Real programs live in many: a file is a module, a folder of modules is a package, and import is the glue. This phase explains exactly what import does, where Python looks for files, and the mistakes that trip up almost everyone (a file named random.py, a circular import, a relative import that will not run).
You will tour the standard library, the large set of ready-made tools that ships with Python, and learn how to read its documentation. Then you will meet the world outside it: PyPI (the public shop for Python packages), virtual environments (a private folder of packages for each project), pip (the installer), and uv, the modern all-in-one tool. From Topic 6.5 on you will type commands into a terminal, and that topic explains what that is, step by step. You will learn what pyproject.toml is, how version rules work, and why a lock file makes a project reproducible.
The phase ends with the shape of a real project (the src/ layout, tests, entry points, config kept out of code) and how a package is built into a wheel and published, including the habits that keep you safe from bad packages. Many examples here write small files and import them live, so you can watch the machinery work. The tools that need a real terminal (pip, uv) are shown as commands, with short outputs.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.