sublime使用代理服務器安裝package control

自動安裝package control時,有可能使用代理官網(https://sublime.wbond.net/installation#st2)給的做法是沒有代理服務器的配置,下面說下利用代理的方式



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({"http":"http://weixianlong:[email protected]:8080"}))); 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')


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章