Python editor settings (including visual Studio code and sublime Text3)

Source: Internet
Author: User


From source


Python forces indentation, using the TAB key and spaces, but not mixed. Mixing tabs and spaces results in an error: Indentationerror:unindent does not match any outer indentation level. If your editor doesn't visualize spaces and tabs, it's crazy to change.


PEP8 recommends using spaces to indent. Because different editors, the IDE handles the TAB key differently, some widths are 4, and some are 8.

Configure the following to modify the configuration of visual Studio code and sublime Text3 to visualize spaces and tab keys, and to have 4 spaces instead of 1 tab when you enter the TAB key.
Visual Studio codefile->preferences->user Settings Right window, JSON code:
{ "editor.tabSize": 4, 
"Editor.insertspaces":true,
 "editor.renderWhitespace": true,
 "draw_white_space": "all"}


Sublime text3preferences->settings User, add two entries to the JSON configuration file
" translate_tabs_to_spaces " :   Span class= "pun" style= "Color:rgb (147,161,161)", 
 " Draw_white_space " :     "all"  


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.



Python editor settings (including visual Studio code and sublime Text3)


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.