Consider using console_scripts
:
from setuptools import setup
setup(name='some-name',
...
entry_points = {
'console_scripts': [
'command-name = package.module:main_func_name',
],
},
)
Where main_func_name
is a main function in your main module.
command-name is a name under which it will be saved in /usr/local/bin/ (usually)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…