1.首先安装包管理器,按ctrl+`,打开sublime的console:输入
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
2.ctrl+shift+p,调出包管理器:输入install package
3.输入sublimeREPL,点击安装
4.点击tool,找到sublimeREPL,然后选择python
5.在弹出的页面中编写代码,或者执行execfile(filepath)即可