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了

posted @ 2019-08-22 21:30  朵朵奇fa  阅读(2319)  评论(0编辑  收藏  举报