python通过sublime运行不同版本python

来源:互联网 发布:淘宝查购买顺序 编辑:程序博客网 时间:2024/06/05 19:46

前面已经安装了两个版本的python,想要在sublime中直接运行python程序,并且可以指定python版本的话,需要这样设置:

sublime中,Preferences ------Browse Packages打开后,进入User目录

新建Python3.sublime-build文件,并写入:

{

"cmd":["python3.exe", "-u", "$file"],

"path":"C:/Users/sheng/AppData/Local/Programs/Python/Python36",

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

}

回到sublime,Tools------Build System,选择python3后即可使用Ctrl+B来使用python3运行程序(python2同理)