写了一个module,执行 python setup.py install 后,希望将此脚本变成为 系统命令,可以这样来做:
主要是修改 setup.py 文件
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)