打開終端,添加sublime text 3的倉庫:python
sudo add-apt-repository ppa:webupd8team/sublime-text-3
按enter鍵繼續web
更新軟件庫:sublime-text
sudo apt-get update
安裝Sublime Text 3:測試
sudo apt-get install sublime-text-installer
安裝package control:ui
ctr+`調出控制檯而後粘貼以下python代碼:url
import urllib.request,os,hashlib; spa
h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 3d
pf = 'Package Control.sublime-package';code
ipp = sublime.installed_packages_path();orm
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)
建議去官方網址複製粘貼代碼:https://packagecontrol.io/installation
激活:
—– BEGIN LICENSE —– Free Communities Consultoria em Informática Ltda Single User License EA7E-801302 C154C122 4EFA4415 F1AAEBCC 315F3A7D 2580735A 7955AA57 850ABD88 72A1DDD8 8D2CE060 CF980C29 890D74F2 53131895 281E324E 98EA1FEF 7FF69A12 17CA7784 490862AF 833E133D FD22141D D8C89B94 4C10A4D2 24693D70 AE37C18F 72EF0BE5 1ED60704 651BC71F 16CA1B77 496A0B19 463EDFF9 6BEB1861 CA5BAD96 89D0118E —— END LICENSE ——
配置Python環境:
Ctrl+shift+P打開package control:輸入install Package
而後輸入Anaconda,安裝。
測試Python代碼,發現代碼上有方框。
解決辦法:
Preferences - Package Settings - Anaconda - Setting User
輸入;
{ "anaconda_linting": false, //保存文件後自動pep8格式化 "auto_formatting": true, }
保存,而後ctrl+B運行Python代碼。