Sublime Text 3 Python and package control configuration methods

Source: Internet
Author: User
Tags sublime text



(If the following method tries the Packages control function , it is not possible to refer to this method:



1. Directly delete the original Packages control folder under the C:\Sublime Text 3x64\data\packages\ directory.



2. Manually download the Packages control plugin:https://packagecontrol.io/Package%20Control.sublime-package



3. Take the downloaded plugin to the C:\Sublime Text 3x64\data\installed Packages directory to reopen the Sublime so



4. There are also: some people ask why Ctrl+b compiled the code after the console does not display the results: The first time ctrl+b choose Python do not choose to check the syntax just fine








(The source of the following method: Http://www.cnblogs.com/waising/articles/3466120.html)



You can configure the Python environment by referring to the following methods:



Package Control Installation Method



1. Open the console by pressing CTRL + ' or View > Show console, then paste the appropriate Python installation code;



2.Sublime Text 3 Installation code and enter:



Import Urllib.request,os; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); Open (Os.path.join (IPP, PF), ' WB '). Write (Urllib.request.urlopen (' http://sublime.wbond.net/' + pf.replace (', '%20 ')) . Read ())



3. Restart Sublime Text 3;



4. If you see the package control item in Perferences->package settings, the installation succeeds.


To install a plugin using the package control method:
    1. Press Ctrl+shift+p to bring up the command panel
    2. Enter install to bring up the Install Package option and enter, then select the plug-in you want to install in the list. :


pylinter.sublime-settings Configuration of the Pylinter plugin. I use the following configuration to let Pyhton automatically spec when saved and display icons for violations of the specification.


 1 {
 2     // Configure pylint‘s behavior
 3     "pylint_rc": "/Users/daniel/dev/pylintrc",
 4  
 5     // Show different icons for errors, warnings, etc.
 6     "use_icons": true,
 7  
 8     // Automatically run Pylinter when saving a Python document
 9     "run_on_save": true,
10  
11     // Don‘t hide pylint messages when moving the cursor
12     "message_stay": true
13 }





Sublimecodeintel Plug-in



Smart Tips plugin, this plugin smart tips feature is very powerful, can customize the content Library of hints, my Python smart tips settings


 1     "Python": {
 2         "python":"D:/Python27/python.exe",
 3         "pythonExtraPaths":
 4             [
 5                 "D:/Python27",
 6                  "D:/Python27/DLLs",
 7                  "D:/Python27/Lib",
 8                  "D:/Python27/Lib/lib-tk",
 9                  "D:/Python27/Lib/site-packages"
10             ]
11         }





Python PEP8 Autoformat Plugin






This is used to press PEP8 to automatically format the code. Can be installed in the Package manager. Shortcut keys ctrl+shift+r automatically format python code






Common configuration


 1 {
 2     "auto_complete": false,
 3     "caret_style": "solid",
 4     "ensure_newline_at_eof_on_save": true,
 5     "find_selected_text": true,
 6     "font_size": 11.0,
 7     "highlight_modified_tabs": true,
 8     "line_padding_bottom": 0,
 9     "line_padding_top": 0,
10     "scroll_past_end": false,
11     "show_minimap": false,
12     "tab_size": 4,
13     "translate_tabs_to_spaces": true,
14     "trim_trailing_white_space_on_save": true,
15     "wide_caret": true,
16     "word_wrap": true,
17 }




F12 or Ctrl+b run the py file if it is F12 best to add raw_input after the py file () or CMD will flash over;


Sublime Text 3 Python and package control configuration methods


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.