对于PyPI软件包,我是否可以有多个控制台脚本名称指向setup.py中的同一脚本?

是否可以将多个控制台脚本名称指向同一脚本,这是一个好主意吗?例如:

entry_points={
    'console_scripts': ["the-popular-script = scripts.the_popular_script:main","thps = scripts.the_popular_script:main","the-other-script" = scripts.the_other_script:main"],},

然后the-popular-scriptthps命令都将使用the_popular_script.py

smallkids 回答:对于PyPI软件包,我是否可以有多个控制台脚本名称指向setup.py中的同一脚本?

是的,没有任何问题。

安装程序在安装时会写出这些脚本,因此在安装软件包时,您只需在bin目录sysconfig.get_path("scripts")中写出两个可执行文件。它们的内容相同,但文件名不同。

本文链接:https://www.f2er.com/3084531.html

大家都在问