Python –

Whenever you play with a python package, you will always see some boilerplate files or structures here and there. is a file that resides in most of the packages. And even sometimes, they are empty, so what they do?

Here is a summary of its functionalities:

1. It will treat the directory where it is as a loadable module.
Here is a real world example showing you what difference even an empty makes.

2. You can define __all__ variable in to decide when user type in from package import *, which modules will be loaded.

Screenshot 2015-01-03 11.18.34

3. Define a commonly used variable, check out this Stackoverflow answer.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s