本文轉載自:http://www.javashuo.com/article/p-qljgxheg-eh.htmlcss
一、官方網站地址html
二、Windows 10python
三、Sublime Text 3 + 官網購買license(Just a suggestion,$80)windows
購買連接,Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use。若是資金緊張,能夠搜索破解版License(建議支持正版,本文再也不提供破解版License)。ide
一、雙擊下載的.exe文件安裝,安裝路徑不要有中文目錄測試
一、打開Tools > Build System > New Build System..字體
{ "cmd": ["D:/Anaconda3/python.exe","-u","$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", }
如圖:網站
三、打開Tools > Build System,選擇新建好的Python3便可ui
測試lua
一、新建test.py文件,輸入簡單python語句,按Ctrl+B運行
一、打開Preferences –>>Settings(Settings User),在右側添加以下代碼(font_face及font_size可根據我的喜愛更改)
{ "color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme", "font_face": "Consolas", "font_size": 14, "ignored_packages": [ "Vintage" ], "update_check": false, // The number of spaces a tab is considered equal to "tab_size": 4, // Set to true to insert spaces when tab is pressed "translate_tabs_to_spaces": true, //設置保存時自動轉換 "expand_tabs_on_save": true }
二、效果以下
4、安裝Package Control(官網教程)
第一種方法:在線安裝
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 Text 3,若是是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')
關掉並從新打開Sublime Text 3,若是在Perferences->package settings中能看到package control這一項,則表示安裝成功。
第二種方法:手動安裝
一、點擊 Preferences > Browse Packages… 菜單
二、Browse up a folder and then into the Installed Packages/ folder
三、Download Package Control.sublime-package and copy it into the Installed Packages/ directory
四、Restart Sublime Text
一、經過Package Control安裝其餘插件
1.按下Ctrl+Shift+P調出命令面板
2.輸入install 調出 Install Package
3.在列表中選中要安裝的插件,或者輸入插件名,根據命令面板中的過濾結果,選擇要安裝的插件
二、經過Package Control查看已安裝的插件
1. 按下Ctrl+Shift+P調出命令面板
2. 輸入"package",在下拉列表找到"Package Control: list packages",選中後回車,能夠顯示所有插件列表。
介紹
Full-featured code intelligence and smart autocomplete engine
Jump to Symbol Definition - Jump to the file and line of the definition of a symbol.
Imports autocomplete - Shows autocomplete with the available modules/symbols in real time.
Function Call tooltips - Displays information in the status bar about the working function.
支持語言
JavaScript, ES6, Mason, XBL, XUL, RHTML, SCSS, Python, HTML, Ruby, Python, XML, XSLT, Django, HTML5, Perl, CSS, Twig, Less, Smarty, Node.js, Tcl, TemplateToolkit, PHP.
Installation
1.Control+Shift+P打開Package Control控制檯
2.輸入install,選擇關聯出來的install package
"python3":{ "python":"D:/Anaconda3/python.exe", "pythonExtraPaths":[ "D:/Anaconda3/DLLs", "D:/Anaconda3/Lib", "D:/Anaconda3/Lib/lib-tk", "D:/Anaconda3/Lib/site-packages", ] }
如圖:
7.保存,重啓Sublime Text 3
測試
新建文件並保存爲.py文件,輸入代碼測試
SublimeREPL
介紹
添加快捷鍵後,可直接運行當前文件,很是方便
Launch python in local or remote(1) virtualenv.
Quickly run selected script or launch PDB.
Use SublimeText Python console with history and multiline input.
使用方法
[ { "keys": ["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } } ]
測試
一、新建test.py文件,例如:
二、上文中SublimeREPL插件設置的快捷鍵是F5,因此按F5運行成功以下
介紹
安裝插件後,能夠經過快捷鍵按照模板快速新建文件
使用方法
一、安裝SublimeTmpl插件後,打開Preferences->Package Settings->SublimeTmpl->Settings User,添加如下內容
{ "disable_keymap_actions": false, // "all"; "html,css" "date_format" : "%Y-%m-%d %H:%M:%S", "attr": { "author": "Yong Lee", "email": "honkly@163.com", "link": "http://www.cnblogs.com/honkly/" } }
如圖:
二、添加快捷鍵,打開Preferences->Key Bindings,添加紅框中的快捷鍵代碼
[ { "caption": "Tmpl: Create python", "command": "sublime_tmpl", "keys": ["ctrl+alt+n"], "args": {"type": "python"} }, { "keys": ["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" } } ]
如圖:
測試
打開Sublime Text 3,上文中SublimeTmpl插件設置的快捷鍵是"Ctrl+alt+n",按快捷鍵後成功新建文件以下
介紹
提供了主題更換功能,可根據我的喜愛選擇
使用方法
一、安裝ColorSublime插件完成後,打開Preferences->Color Scheme...,選擇主題
Anaconda
介紹
代碼提示等許多功能,必備
安裝方法
一、Preferences->Package Settings->Anaconda->Settings Default,修改"python_interpreter"爲實際Python安裝路徑
二、Preferences->Package Settings->Anaconda->Settings User,添加以下內容
{ "python_interpreter":"D:/Anaconda3/python.exe", "suppress_word_completions":true, "suppress_explicit_completions":true, "comlete_parameters":true, "swallow_startup_errors":true, "anaconda_linting":false }
如圖:
測試
一、打開Sublime Text3,新建任意*.py文件,輸入語句測試,如圖