build_system
m1
{
"cmd": ["python3", "-u", "$file"],
"path":"D:/program/python37",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python3"
}
m2
{
"shell_cmd": "D:/Anaconda3/envs/bigdata/python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
cmd运行
{
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python -m py_compile \"${file}\"",
},
{
"name": "Run in cmd",
"shell_cmd": "start cmd /c \"python ${file} & pause\"",
}
]
}
python 自动联想
1,安装Package Control
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
2,preferences => package setting => package contrl => setting - user
{
"python_interpreter":"D:/program/Anaconda3/envs/py37_gq/python.exe",
"suppress_word_completions":true,
"suppress_explicit_completions":true,
"comlete_parameters":true,
"swallow_startup_errors":true,
"anaconda_linting":false
}