Hello当我使用sublime text 3,使用python时,让我们说2.7.13,如何在每次运行python脚本时都让构建输出python版本?
我可以在设置文件中添加命令吗?
目前设置为(Python.sublime-build)
{
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
}
答案 0 :(得分:2)
最简单的方法可能是修改构建,使其运行python
两次,一次打印版本,第二次实际执行脚本:
{
"shell_cmd": "python --version && python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"}
}