Sublime text 如何安装 package control

  • 3550
请先 登录 后评论

1 个回答

XY - 开发者 @ 学研谷
擅长:LS-DYNA,AUTODYN

通过 Sublime Text 控制台。可通过快捷方式“ctrl+`”或“View > Show Console”菜单访问控制台。打开后,将适用于您的 Sublime Text 版本的 Python 代码粘贴到控制台中。

Sublime Text3 贴入如下代码:

import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93D5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); 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)

Sublime Text2 贴入如下代码:

import urllib2,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93D5f746d80ef60'; 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()) ); by = urllib2.urlopen('http://packagecontrol.io/' + pf.replace('','%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf),'wb').write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install'% (dh, h) if dh != h else'Please restart Sublime Text to finish installation')

请先 登录 后评论