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

如何使用 Python 写出交互式的命令行程序

  •  
  •   caizixian ·
    caizixian · Apr 12, 2015 · 3625 views
    This topic created in 4058 days ago, the information mentioned may be changed or developed.
    就像fdisk之类的一样
    有旧帖提到这个问题 /t/99667
    不过貌似没有很好的答案。
    不知到有没有什么方法/库能够做到这一点(最好支持tab补全)

    目前能想到的一种方式就是input('>')然后自己读进来,但是感觉很不优雅,也不支持补全
    5 replies    2015-04-15 11:48:11 +08:00
    cbsw
        1
    cbsw  
       Apr 12, 2015
    http://pymotw.com/2/cmd/ 里面提到有 tab 补全
    swordfeng
        2
    swordfeng  
       Apr 12, 2015 via Android   ❤️ 1
    curses?
    wenLiangcan
        3
    wenLiangcan  
       Apr 12, 2015
    Library for building powerful interactive command lines in Python:

    https://github.com/jonathanslenders/python-prompt-toolkit
    wuyu1998
        5
    wuyu1998  
       Apr 15, 2015
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1226 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:55 · PVG 07:55 · LAX 16:55 · JFK 19:55
    ♥ Do have faith in what you're doing.