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.

By

Updated

Cheat sheet: Your Own Modules and Packages
Category
Python
Level
Apprentice
Tags
__init__.py, from … import, Main Guard (if __name__ == "__main__"), Module (python), Package (python), python