Use the entrypoints in your setup.py
from setuptools import setup, find_packages
setup(
name='Foo',
version='1.0',
packages=find_packages(),
url='https://github.com/Bar/Foo.git',
install_requires=[
],
license='',
classifiers=[
'Development Status :: 3 - Alpha',
],
keywords='foo bar',
author='Mr Foo',
entry_points={
'console_scripts': [
'foo = library_name.Foo:main',
],
},
)
This way when you python setup.py install you can call foo from shell and it will execute main in Foo.py
Note that you need to change library_name, foo, Foo and main in case they have different names in your code.