Python Language Creating Python packages Making package executable


If your package isn't only a library, but has a piece of code that can be used either as a showcase or a standalone application when your package is installed, put that piece of code into file.

Put the in the package_name folder. This way you will be able to run it directly from console:

python -m package_name

If there's no file available, the package won't run with this command and this error will be printed:

python: No module named package_name.__main__; 'package_name' is a package and cannot be directly executed.