好多人在学习编写代码的时候,会有不同的编辑器,大神们建议我使sublime,但是我在里面写代码,没有一点提示,我的天,不得烧坏我的脑子啊。学Python我用的Ananconda,但是这个spyder有点儿不顺啊。所以来搞搞。
首先要在sublime中安装package control:
在view中选择show console,然后打开下面的链接
输入:
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
在preferences中的packages control中输入 install package
在里面输入Anaconda
安装完成后会显示messages文档。
扫描二维码关注公众号,回复:
2852178 查看本文章
由于插件本身无法知道Python安装的路径,所以需要手动设置Python主程序的位置。选择Preferences-package Setting-Anaconda-Settings-Default。
选择Preferences-package Setting-Anaconda-Settings-Users选项,键入以下json数据。保存,重启sublime即可
{
"python_interpreter":"D:/Anaconda/python.exe",
"suppress_word_completions":true,
"suppress_explicit_completions":true,
"comlete_parameters":true,
"swallow_startup_errors":true,
"anaconda_linting":false
}
上面1是我安装anaconda的路径,因为装了anaconda就把python装了。所以没必要按照网上的教程,搞其他的路子。
2呢是解决一个重要的问题,如下:
3呢是解决出现白色框的问题。
接下来,sublime3编写python代码时会有提示功能。
而且很听话!