What's __init__.py? PREMIUM

Series: Modules
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
3 minute read Python 3.7—3.10

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.