I. Preparatory work
1.python python , and install, configure environment variables (computer-Properties-Advanced system settings-add Python installation path in environment variable-path)
2.sublime Text 3 sublimetext3 , and install
Two. Configuring the Python environment for Sublime Text3
1. Install the package Control
Open the console with the shortcut key Ctrl + ' or View > Show console
Then paste the appropriate Python installation code below, or click here
import urllib.request,os,hashlib; h = ' 2915d1851351e5ee549c20394736b442 ' + ' 8bc59f460fa1548d1514676163dafc88 ';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 (' Errorvalidating 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)
and press ENTER to wait for the installation to complete
2 Installing the Python plugin with packpage control
Press Ctrl+shift+p to bring up the command panel and enter PCIP to select the first: Install package
Then enter the Python plug-in name and install
A few Python plugins are listed below:
All autocomplete
Sublime Default Auto-completion only focuses on the words of the current file. This plugin expands its AutoComplete word list to all open files.
Sublimecodeintel
Enhanced Auto-completion for some languages, including Python. This plugin also allows you to jump to the definition of the symbol, by holding down ALT and clicking on the symbol. Very convenient.
Sublimerepl
allows you to run the Python interpreter directly from the editing interface.
Gitgutter
in the Groove area of the editor, according to Git, add a small icon to identify whether a row has been inserted, modified, or deleted. In Gitgutter's readme, there are instructions on how to change the color icon to update your color scheme file.
Pylinter
it automatically checks the. py file whenever it is saved and displays the Pylint violation directly in the editing interface. It also has a shortcut to disable the partial pylint check by inserting a #pylint: disables the comment.
Anaconda
is currently the best Python auto complement and syntax hint plugin in Sublime 3, and provides plug-ins in the IDE such as "Jump to Definition", "Find using", "Show Document", "Auto rename".
sidebarenhancements
provides enhanced functionality for the default sidebar. Sublime's sidebar can be paged out using shortcut keys Ctrl+k ctrl+b (Linux, Win), Cmd+k cmd+b (OS X). After installation, you can also open the current file in the browser via the F12 key.
It's enough for me to just press anaconda and sidebarenhancements.
3. Run the Python file
When editing Python code, save it and then run it with sublime text
The operation flow of the above results:
Open Sublime Textb, write Python code print ' Hello,world. ' Click File-save
After saving, press Ctrl+b in the editor to run the program, get the effect
Sublime Text 3 builds a python development environment