首先打开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了
原文地址:https://www.cnblogs.com/shunguo/p/11396976.html
时间: 2024-11-09 02:12:45