V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
AbcHiyi
V2EX  ›  Python

Python 的某些库附带了可执行工具,这些工具是怎么被打包到一起的呢?尝试了很多次总是不得要领

  •  
  •   AbcHiyi · 2020-11-23 16:18:22 +08:00 · 1785 次点击
    这是一个创建于 1221 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如像 django,virtualvenv 这些

    6 条回复    2020-11-24 14:15:50 +08:00
    abersheeran
        1
    abersheeran  
       2020-11-23 16:25:47 +08:00
    你说的是 django-admin 这种命令行命令吧?去看 Django 的 GitHub 仓库里根目录下的 setup.py 文件就行。

    而且纠正一点,不是把可执行文件打包过去的,而是安装的时候才产生的可执行文件。并且这些可执行文件其实就是调用某个 Python 函数的快捷方式,也不是什么复杂的东西。
    westoy
        2
    westoy  
       2020-11-23 16:26:18 +08:00
    docker 大法好
    AbcHiyi
        3
    AbcHiyi  
    OP
       2020-11-23 17:34:51 +08:00
    @abersheeran 哦哦 谢谢
    xiaket
        5
    xiaket  
       2020-11-23 19:27:57 +08:00
    楼上第二个链接的 setup.py 里面看看 entry_points 设置
    julyclyde
        6
    julyclyde  
       2020-11-24 14:15:50 +08:00   ❤️ 1
    @xiaket 应该是 console_scripts
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   948 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:03 · PVG 05:03 · LAX 14:03 · JFK 17:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.