Sublime 如何 Build Python
- New Build System
- 添加新的命令 Path : Library/Application Support/Sublime Text 3/Packages/User/
- Add Python :
{
"cmd":["/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7","-u","$file"],
}
Sublime 運行 Python 語法錯誤
錯誤提示 : IndentationError: unindent does not match any outer indentation level
問題原因 : Tab 和 Space 的空格不同
解決方法 : Prefences -> Settings -> Default
"draw_white_space": "all", # 空格用劃線顯示
"translate_tabs_to_spaces": true # 用 space 代替 tab
Sublime Python 控制臺支持輸入
- 安裝插件 SublimeRPEL
- Rrefences -> Settings -> Key Bindings 添加
[
{ "keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args":{"id": "repl_python_run","file": "config/Python/Main.sublime-menu"}}
]
- F5+Fn 運行 Python
Sublime 快捷鍵
ctrl+` 顯示控制臺
ctrl+shift+p
Sublime 手動安裝 Package Control
- 前往 GitHub 下載
- 將 package_control 文件夾復制到 Preferences->Browse Packages
- 重啟 Sublime,如果 Preferences 有 PackageSetting 和 Package Control 就說明安裝成功
-
CTRL+SHIFT+P輸入 install 選中 Install Package 就可以安裝插件 - Python 代碼補全插件:Python AutoComplete
使用 Package Control 無法安裝插件
錯誤提示 : There are no packages available for installation
解決方法 :
- 前往 GitHub 下載
- Preferences -> Package Setting -> Package Control -> Setting User 用戶下設置
"channels": [
"$(channel_v3.json - path)"
]