1.已安装python并正确配置环境变量,Win+R调出运行弹框,输入cmd,进入dos窗口,输入python可查看python是否安装并配置环境变量,如图可看到已安装的python版本号
python下载地址:https://www.python.org/downloads/
2.sublime与python关联
Performance--->点击Browse Packages进入Package目录下,创建Python文件夹,并在Python文件下创建Python.sublime-commands文件
Python.sublime-commands内输入,其中path后面跟的是python安装路径
{
"cmd":["python.exe", "-u", "$file"],
"path":"C:python36",
"file_regex": "^[ ]*File "(...*?)", line ([0-9]*)",
"selector": "source.python"
}
3.执行python文件,Tools--->点击Build即可执行python文件