转https://blog.csdn.net/xtfge0915/article/details/52368350
Tools->build system->new build system
{
"shell_cmd": "python -u \"$file\"",/*修改*/
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python -m py_compile \"${file}\"",/*修改*/
}
]
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
如果使用的是python3改成
"shell_cmd": "python3 -u \"$file\""
- 1
然后在Tools->build system中选择自己定义的解释器