在Mac下安装sublime_text的包管理文件,想请教~
装好sublime text后,在线安装Package control包管理器不成功,control+`打开控制台,输入
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')
敲回车,重启后,还是没有安装上,试了好多遍~请问怎么回事?
Answers
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())
楼主,这个才是3的