python神器_python 一款神器:prompt-toolkit

9

2014-10-01 09:23:31 +08:00 heart_neue_red.png?v=16ec2dd0a880be6edda1e4a2e35754b3 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.)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值