作者:知乎用戶
鏈接https://www.zhihu.com/question/22904994/answer/87527103
來源:知乎
如果是想在sublime里要python shell那種交互或者run module F5 F5 F5下這種效果的話薯酝,還是挺容易實(shí)現(xiàn)的,windows下的:
- 打開Sublime text 3 安裝package control</u>
Sublime Text 3 安裝Package Control
- 安裝 SublimeREPL
Ctrl+shift+p 鍵入 install packages
稍等片刻后 鍵入 SublimeREPL 安裝即可
通過選項(xiàng)Tools->SublimeREPL->Python就可以看到效果了
- 鍵位綁定
當(dāng)然每次通過Tools->SublimeREPL->Python這樣的方式比較繁瑣
將這樣的操作和一個(gè)按鍵如F1綁定后波势,就會(huì)方便很多啦
e.g.打開Preferences->Key Bindings-User如暖,復(fù)制以下代碼:
{"keys":["f1"],
"caption": "SublimeREPL: Python",
"command": "run_existing_window_command", "args":
{"id": "repl_python",
"file": "config/Python/Main.sublime-menu"}}
Ctrl+s下就好了~
相較于純白如雪的原版idle,Sublime實(shí)在是色彩繽紛:-)
ps 如果還想編譯下熱乎乎的py代碼笆檀,可以復(fù)制以下代碼:
{"keys":["f2"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args":
{"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"}}