python学习笔记(2)--sublimeText3运行python

https://www.zhihu.com/question/22904994

知乎用户 To the knowledge
如果是想在sublime里要python shell那种交互或者run module F5 F5 F5下这种效果的话,还是挺容易实现的,windows下的:
1. 打开Sublime text 3 安装package control
Sublime Text 3 安装Package Control

2. 安装 SublimeREPL

Ctrl+shift+p 键入 install packages

稍等片刻后 键入 SublimeREPL 安装即可

通过选项Tools->SublimeREPL->Python就可以看到效果了

3. 键位绑定

当然每次通过Tools->SublimeREPL->Python这样的方式比较繁琐

将这样的操作和一个按键如F1绑定后,就会方便很多啦

e.g.打开Preferences->Key Bindings-User,复制一下代码:

{"keys":["f1"],
"caption": "SublimeREPL: Python",
"command": "run_existing_window_command", "args":
{"id": "repl_python",
"file": "config/Python/Main.sublime-menu"}}

Ctrl+s下就好了~
python学习笔记(2)--sublimeText3运行python
相较于纯白如雪的原版idle,Sublime实在是色彩缤纷:-)
ps 如果还想编译下热乎乎的py代码,可以复制以下代码:

{"keys":["f2"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args":
{"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"}}

感谢评论的小伙伴们,祝大家新年快乐啦!

上一篇:基础数据类型之AbstractStringBuilder


下一篇:mysql更新字段值提示You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode