像 you-get 一样
$ pip3 install you-get
$ which you-get
/usr/local/bin/you-get
$ cat /usr/local/bin/you-get
#!/usr/local/opt/python/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from you_get.__main__ import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
查看了源码和 setup.py ,并没有看出什么端倪。
1
shawndev OP django-admin 同理
|
2
shawndev OP 我发布了一个 pypi,叫作 ghtrending,每次都要 python3 -m ghtrending 很麻烦,想简化成 ghtrending
|
3
frostming 2019-01-04 11:31:20 +08:00
setup 函数里加上:
entry_points = { 'console_scripts': ['ghtrending=ghtrending.__main__:main'] } https://packaging.python.org/guides/distributing-packages-using-setuptools/#id59 |
5
Trim21 2019-01-04 11:33:23 +08:00
|