首先打開cmd,運行一下這個代碼:start cmd /c \" python \"$file\" & pause\"
然后打開sublime-tool-build system-build new system
刪除所有 copy-paste下面這些代碼:
{
// 指定python.exe的目錄【針對未將python加入環境變量的】
// "path": "",
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name" :"Run cmd",
"shell" :true,
"shell_cmd":"start cmd /c \" python \"$file\" & pause\""
}
]
}
保存名字為PythonRun.sublime-build
然后打開一個python程序:按ctrl+shift+b
選擇python run cmd
就可以了
以后再運行python程序就之家按ctrl+B就可以了 就會調用cmd來運行python了