2、打开后我们会看到这样两个文件,一个Preferences.sublime-settings--Default和Preferences.sublime-settings--User,个中User的文件便是须要编辑的
3、修正配置
在文件的大括号中写入这么一段配置信息/代码,之后保存:
// Settings in here override those in 34;Default/Preferences.sublime-settings",// and are overridden in turn by syntax-specific settings.{ "python":{ "Python":"D:/Program Files/Python36/python.exe", "pythonExtraPaths": [ "D:/Program Files/Python36", "D:/Program Files/Python36/DLLS", "D:/Program Files/Python36/Lib", "D:/Program Files/Python36/Lib/site_packages" ] }, }
4、新建文件
这样配置完成后,实行Ctrl-B该当是可以实行了,但是创造没有输出信息,那么就须要下面的这段配置了
File--->New File 新建一个文件,保存名称为Python3.sublime-build,在里面同样须要写一段配置信息/代码,保存:
{ "shell_cmd": "python -u \"$file\"", "file_regex": "^[ ]File \"(...?)\", line ([0-9])", "selector": "source.python", "encoding":"CP936"}
import requestsreg = requests.get('http://www.baidu.com')# reg.encoding = 'gbk'# reg.encoding = 'gb2312' 仍旧会报错print (reg.text)
6、点击菜单栏中的Tools —> Build System,勾选Python3
以为有用的朋友多帮忙转发哦!
后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~