標籤:設定 exist pack 網址 nbsp control python開發 python3 cond
安裝階段:
- sublime text3的安裝:
- 下載網址:https://www.sublimetext.com/
- 下載完成後 ,點擊安裝即可。
- 安裝Package Control:
- 點擊 Tools -> install Package Control
- 安裝anaconda:
- ctrl+shift+p -> 輸入install package -> 輸入anaconda -> 斷行符號
- 安裝SublimeREPL:
- ctrl+shift+p -> 輸入install package -> 輸入 sublimeREPL -> 斷行符號
- 安裝Djaneiro:
- ctrl+shift+p -> 輸入install package -> 輸入 Djaneiro -> 斷行符號
設定階段:
Preferences -> Browse Packages -> SublimeREPL -> config -> python ->開啟 Main.sublime-menu -> 找到
{"command": "repl_open", "caption": "Python - RUN current file", "id": "repl_python_run", "mnemonic": "R", "args": { "type": "subprocess", "encoding": "utf8", "cmd": ["python", "-u", "-i", "$file_basename"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", "extend_env": {"PYTHONIOENCODING": "utf-8"} } },
修改其中的 "cmd" 項。
-
如果電腦上裝有python2和python
-
- 想要使用python2的cmd就填入 "cmd": ["python", "-u", "-i", "$file_basename"]
- 想要是要python3的cmd就填入 "cmd": ["python3", "-u", "-i", "$file_basename"]
如果電腦中只有一個python版本
-
- 直接填入"cmd": ["python", "-u", "-i", "$file_basename"]
- 自訂SublimeREPL快速鍵
Preferences -> Browse Package -> SublimeREPL -> config -> python -> 開啟Default.sublime-commands -> 找到
{ "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } },
並複製到 Preferences -> Key Bindings 中,並在代碼中添加想要設定的快速鍵,如下:
{ "keys": ["shift+f10"], //修改方括弧中的內容,自訂快速鍵 "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } },
sublime text3配置python開發環境(windows版)