码迷,mamicode.com
首页 > 其他好文 > 详细

421

时间:2018-11-16 01:10:26      阅读:338      评论:0      收藏:0      [点我收藏+]

标签:sublime   SHA256   ges   imp   pat   open   handle   nload   join   

41

import urllib.request,os,hashlib; h = ‘7183a2d3e96f11eeadd761d777e62404‘ + ‘e330c659d4bb41d3bdf022e94cab3cd0‘; 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://sublime.wbond.net/‘ + 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)

421

标签:sublime   SHA256   ges   imp   pat   open   handle   nload   join   

原文地址:https://www.cnblogs.com/lixiaopengcc/p/9966986.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!