# \_\_init\_\_.py

*noun*

say it: **“DUN-der IN-it dot PY”** **/ˈdʌndər ˈɪnɪt dɑt ˈpaɪ/**

A file inside a folder that marks the folder as a Python package; it can be empty, or hold code that runs when the package is first imported.

## What is an `__init__.py` file?

An `__init__.py` file marks a folder as a Python package. It can be empty, or hold code that runs when the package is first imported.

```python
# shop/__init__.py
from .cart import add_item   # lets people write: from shop import add_item
```

## In a sentence

- “Adding an empty **\_\_init\_\_.py** made the shop folder a package.”
- “The **\_\_init\_\_.py** file imports add_item so callers can write from shop import add_item.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/init-py
