标签:epo 保存 插件 str 控制台 方法 需要 idle 方便
2. 添加我们安装python的路径就ok了。
输出在自身的控制台中,部署到这一步,就可以正常使用了。
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‘)
如果是Sublime Text 3,代码如下:
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())
[{"keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" }}]
或者
其实我们可以像IDLE一样运行Python,也设置一个快捷方式如下
[ {"keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" }}, {"keys":["f4"], "caption": "SublimeREPL: Python", "command": "run_existing_window_command", "args": { "id": "repl_python", "file": "config/Python/Main.sublime-menu" }} ]
配置Sublime Text2的python运行环境(Sublime Text 3也类似)
标签:epo 保存 插件 str 控制台 方法 需要 idle 方便
原文地址:http://www.cnblogs.com/fanbi/p/7764362.html