在目录下D:\Sublime Text\Data\Packages\User下创建Python.sublime-build 文件,
注意配置sublime插件是容易出错的,安装Python路径不要包括中文,对中文支持不好,容易出错,
注意路径后加上python.exe,
把这里的D:/Python36/python.exe 改成自己的Python安装目录
注意这里使用 / 而不能是 \ ,不然就会报错,当时坑了我半个小时查错。
{
"selector": "source.python",
"cmd": ["D:/Python36/python.exe","-u","$file"],
"variants": [
{ "cmd": ["ls -l *.py"],
"name": "List Python Files",
"shell": true
},
{ "cmd": ["wc", "$file"],
"name": "Word Count (current file)"
},
{ "cmd": ["python", "-u", "$file"],
"name": "Run"
}
]
}