# Your Own Modules and Packages

Any .py file is a module another file can import, so a growing program is split into files by job, a folder of them with \_\_init\_\_.py becomes a package, and the \_\_name\_\_ check keeps a file's own test lines from running when it's imported.

![Cheat sheet: Your Own Modules and Packages](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/b8e5c613d0254254bb9306cb3976a989.webp)

- Category: Python
- Level: Apprentice
- Tags: \_\_init\_\_.py, from … import, Main Guard (if \_\_name\_\_ == "\_\_main\_\_"), Module (python), Package (python), python
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-modules-your-own-cheat-sheet
