Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Distribution demo 2

  • The name of the package (demo2a in setup.py) and the name of the module (the filename demo2b.py) don't neet to be the same.
  • The name of the folder (demo2)
def whoami():
    print(__file__)

if __name__ == "__main__":
    whoami()
from distutils.core import setup

setup(
    name='demo2a',
    version='1.0',
)
  • Install:
pip install .
  • Use the name of the module
python -m demo2b
  • Uninstall using the package name
pip uninstall demo2a --yes