V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Nov 23, 2020 · 2573 views
    This topic created in 1991 days ago, the information mentioned may be changed or developed.

    例如像 django,virtualvenv 这些

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

    而且纠正一点,不是把可执行文件打包过去的,而是安装的时候才产生的可执行文件。并且这些可执行文件其实就是调用某个 Python 函数的快捷方式,也不是什么复杂的东西。
    westoy
        2
    westoy  
       Nov 23, 2020
    docker 大法好
    AbcHiyi
        3
    AbcHiyi  
    OP
       Nov 23, 2020
    @abersheeran 哦哦 谢谢
    xiaket
        5
    xiaket  
       Nov 23, 2020
    楼上第二个链接的 setup.py 里面看看 entry_points 设置
    julyclyde
        6
    julyclyde  
       Nov 24, 2020   ❤️ 1
    @xiaket 应该是 console_scripts
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1680 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:24 · PVG 00:24 · LAX 09:24 · JFK 12:24
    ♥ Do have faith in what you're doing.