What's __init__.py? PREMIUM

Series: Modules
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
3 min. read Watch as video Python 3.8—3.12
Python Morsels
Watch as video
03:16

How can you make a Python module out of a directory?

What are Python packages?

If you see a directory that has a __init__.py file within it that directory is meant to be a Python package.

For example, this food_utils directory is meant to be a Python package:

...

A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.

Python Morsels
Watch as video
03:16