sajad torkamani

In a nutshell

The file tells Python to treat a directory as a package. file will automatically be executed any time the package is imported. This can be useful if you need to run some package initialization code or if you want to export some members (e.g., functions, classes, constants, etc) directly under the package namespace (e.g., instead of under a module within the package (e.g.,

You typically create an file for each directory that you want to act as a package (a collection of related modules). For example, the Django framework organizes its code into a number of packages, including the following:

Sources / related

Tagged: Python