python 一款神器:prompt-toolkit - V2EX
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
cbsw
V2EX    Python

python 一款神器:prompt-toolkit

  •  
  •   cbsw
    dengshuan 2014 年 9 月 30 日 via Android 10082 次点击
    这是一个创建于 4224 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://github.com/jonathanslenders/python-prompt-toolkit
    一款python shell,目前尚处于开发状态,已有功能:输入时代码高亮,多行编辑,补全,Emacs/Vi 快捷键绑定等,还支持 ipython
    14 条回复    2014-10-18 17:33:39 +08:00
    izoabr
        1
    izoabr  
       2014 年 9 月 30 日
    跟bpython那样?
    tedd
        2
    tedd  
       2014 年 9 月 30 日
    的确很棒,还支持vi binding
    cchange
        3
    cchange  
       2014 年 9 月 30 日
    赞 作为工具控一定得收藏并使用
    hahastudio
        4
    hahastudio  
       2014 年 9 月 30 日 via Android
    这个好
    不过我已经快习惯 IPython notebook 了= =
    sorcerer
        5
    sorcerer  
       2014 年 9 月 30 日 via iPhone
    好东西 谢谢分享
    fxbird
        6
    fxbird  
       2014 年 10 月 1 日
    用pychram就够用了,支持jetbrains
    ericls
        7
    ericls  
       2014 年 10 月 1 日
    @fxbird pycharm 是interpreter?
    hatcloud
        8
    hatcloud  
       2014 年 10 月 1 日
    安装完后运行ptpython没反应,刚学Python,不知道怎么弄
    cha1
        9
    cha1  
       2014 年 10 月 1 日   1
    @hatcloud
    安装: $ pip install prompt-toolkit
    运行: $ ptpython

    ------------------------------------------
    如果不行的话,
    1. 我这边的 ptpython是是在 /usr/local/bin/ptpython 中的, 可以看看有没有
    2. find 或者 locate 看有没有ptpython这个文件. 建议: $ sudo updatedb; sudo locate ptpython (find 太慢了...)

    ------------------------------------------
    另外, 如果输入多行语句的话 "Enter"键的作用是换行; "Alt+Enter"是执行
    In [4]: if True: //这里按"Enter"键, 换行
    2. print("Hello World!"); // 按"Alt+Enter", 执行
    Hello World!

    参考:
    Multiline editing

    Usually, multi-line editing mode will automatically turn on when you press enter after a colon, however you can always turn it on by pressing F7.

    To execute the input in multi-line mode, you can either press Alt+Enter, or Esc followed by Enter. (If you want the first to work in the OS X terminal, you have to check the "Use option as meta key" checkbox in your terminal settings. For iTerm2, you have to check "Left option acts as +Esc" in the options.)
    hatcloud
        10
    hatcloud  
       2014 年 10 月 1 日
    @zqhong OK了,原来第一次没安装成功
    kehr
        11
    kehr  
       2014 年 10 月 1 日   1
    很赞的一款工具!
    limbo0
        12
    limbo0  
       2014 年 10 月 11 日
    不错,多行编辑,补全 vi 哈哈
    mulog
        13
    mulog  
       2014 年 10 月 14 日
    试了一下 好用哭了 感谢分享
    有时候就是想写几行试验一下 然后就是懒得开vi
    于是就经常在py的控制台里写了一行十来的function 最后发现打错一个字 然后重来。。
    有了它 麻麻再也不用担心啦^_^
    tolerious
        14
    tolerious  
       2014 年 10 月 18 日
    我觉得乖乖的用PyCharm挺好的
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2945 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 53ms UTC 06:40 PVG 14:40 LAX 23:40 JFK 02:40
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86