[operator]ubuntu + sublime + anaconda 自动补全、指定python版本

ubuntu 、sublime、anaconda都安装好之后,首先要解决的就是自动补全问题

Perference---->Browes Packages --->新建一个Python的文件夹

在这个文件夹下新建Completion Rules.tmPreferences的文件,一定要有空格

这个文件里面的内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>scope</key>
    <string>source.python</string>
    <key>settings</key>
    <dict>
        <key>cancelCompletion</key>
        <string>^(.*(and|or)$)|(s*(pass|return|and|or|(class|def)s*[a-zA-Z_0-9]+)$)</string>
    </dict>
</dict>
</plist>

重启sublime即可

ubuntu默认的python可能是python2版本的,如果需要指定sublime运行python3版本:

tools---->build system---->new build system---->输入以内容

"cmd": ["/usr/bin/python3", "-u", "$file"], "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", "selector": "source.python"

保存为python3.sublime-buildin

然后再回到build system选择python3,执行ctrl + B就可以直接运行

原文地址:https://www.cnblogs.com/baylorqu/p/9871097.html