sublime如何在終端運行python


首先打開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了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM