新建解释器
Tools -> Build System -> New Build System…
{
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python -m py_compile \"\"",
}
]
}
备注:python修改为具体解释器的路径
保存为:**.sublime-build
指定解释器:Tools -> Build System -> **
运行:Ctrl+B
修改解释器
preference -> browse packages -> **.sublime-build
windows
{
"cmd": ["D:/Program Files/py3/Scripts/python.exe","-u","$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "utf-8",
}
保存路径一般如下:
windows:
C:\Users\psy\AppData\Roaming\Sublime Text 3\Packages\User
mac:
/Users/qmp/Library/Application Support/Sublime Text 3/Packages/User