Skip to main content
Loading page…
Python Mastery
Chapter 7
Lesson 3 of 4
Packages & Project Layout
Contents
Notes
Tutor
Concept
What Is a Package?
Loading activity…
Previous
1 / 8
Continue
Contents
Notes
Discussion
Tutor
25 min
8 activities
0 of 8 done
In this lesson
1
What Is a Package?
2
Sub-Packages and Nested Structure
3
A Minimal Package in Action
4
The src/ Layout
5
Absolute vs Relative Imports
6
Common Mistake: Missing __init__.py
7
Package Structure Quiz
8
Design a Package Layout
Objectives
Create a Python package directory with an __init__.py and import from it
Organize code into sub-packages and use both absolute and relative imports
Describe the src/ layout and explain where tests live in a real project
Chapter 7 · Modules, Packages & Imports
The Import System
Writing Your Own Modules
Packages & Project Layout
pip, PyPI & Dependencies
Previous: Writing Your Own Modules
Next: pip, PyPI & Dependencies