Tutorial by Examples

Every package requires a setup.py file which describes the package. Consider the following directory structure for a simple package: +-- package_name | | | +-- __init__.py | +-- setup.py The __init__.py contains only the line def foo(): return 100. The following setup.py...
Once your setup.py is fully functional (see Introduction), it is very easy to upload your package to PyPI. Setup a .pypirc File This file stores logins and passwords to authenticate your accounts. It is typically stored in your home directory. # .pypirc file [distutils] index-servers = py...
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 __main__.py file. Put the __main__.py in the package_name folder. This way you will be able to run it directly ...

Page 1 of 1