sublime python配置運行
阿新 • • 發佈:2019-03-09
... rep con regex hash dash mda int select
1、安裝python環境
安裝完成時,Win+R → 輸入cmd → Enter → 調出來命令行,輸入python確認安裝是否成功。
2、安裝sublime
3、打開sublime,選擇工具——編譯系統——新建編譯系統,復制粘貼下面文件。保存為python3,選擇工具——編譯系統——python3
{ "cmd":["python.exe", "-u", "$file"], "path":"E:\\Program Files\\python3.6", // 註意:路徑根據自己的python安裝路徑而定 "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" }
可以編寫程序了,ctrl + b運行。
4、安裝package control,查看→顯示/隱藏控制臺→打開控制臺粘貼以下代碼→Enter
import urllib.request,os,hashlib; h = ‘df21e130d211cfc94d9b0905775a7c0f‘ + ‘1e3d39e33b79698005270310898eea76‘; 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 python配置運行