推荐学习书目
› 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
smdbh
V2EX  ›  Python

Python 命令行程序,要实现一个简单命令解析功能,用什么模块作为起点比较好,实现快

  •  
  •   smdbh · Jun 28, 2018 · 4803 views
    This topic created in 3060 days ago, the information mentioned may be changed or developed.
    就是一个简单的 shell 功能。
    Supplement 1  ·  Jun 29, 2018
    我看了下感觉开一个线程加 cmd 模块,结构简单点。click 和 fire 这种,还不知道交互要怎么写。
    17 replies  •  2018-06-29 08:45:51 +08:00
    prolic
    prolic
    Jun 28, 2018❤️3
    1
    fire?
    hu6360567
    hu6360567
    Jun 28, 2018 via Android❤️1
    2
    argparse?
    frostming
    frostming
    Jun 28, 2018❤️2
    3
    如果不需要解析--option, 直接 sys.argv
    有--option,用 click

    python-fire 和 docopt 都是不走寻常路,比较酷炫
    ackfin01
    ackfin01
    Jun 28, 2018
    4
    argparse
    mec
    mec
    Jun 28, 2018
    6
    标准库 argparse
    Sylv
    Sylv
    Jun 28, 2018 via iPhone
    7
    click +1
    ArianX
    ArianX
    Jun 28, 2018 via Android❤️1
    8
    cmd 模块?
    xin053
    xin053
    Jun 28, 2018
    9
    click 值得拥有
    XIVN1987
    XIVN1987
    Jun 28, 2018 via Android
    10
    optparse argparse
    linuxchild
    linuxchild
    Jun 28, 2018 via iPad
    11
    听过 fire
    Hopetree
    Hopetree
    Jun 28, 2018
    12
    paramiko
    whoami9894
    whoami9894
    Jun 29, 2018 via Android
    13
    我还在用 getopt ……
    xarrow
    xarrow
    Jun 29, 2018
    14
    click
    Tink
    Tink
    Jun 29, 2018 via iPhone
    15
    getopt
    diggerdu
    diggerdu
    Jun 29, 2018 via iPhone
    16
    fire
    gsw945
    gsw945
    Jun 29, 2018
    17
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2144 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 01:56 · PVG 09:56 · LAX 17:56 · JFK 20:56
    ♥ Do have faith in what you're doing.