Configure PEP8 in Pycharm

Source: Internet
Author: User

Pycharm itself is PEP8 style detection, when you knock the code does not conform to the specification, there will be a wavy line hint. How to change the code to conform to the specification and get rid of these unsightly wavy lines. Here are steps: 2.1 installing AUTOPEP8

CMD window input: Pip install AUTOPEP8 2.2 Install AUTOPEP8 configuration in Pycharm

Tools→extends tools→ Click Plus

Configuration Items

NAME:AUTOPEP8 (free to take)

Tools settings:

PROGRAMS:AUTOPEP8 (if you've already installed it)

Parameters:--in-place--aggressive--aggressive $FilePath $

Working Directory: $ProjectFileDir $

Click Output files→ Add, in the dialog box: Regular expression to match output input: $FILE _path$\: $LINE $\: $COLUMN $\:.*

The use of AUTOPEP8 in Pycharm: Edit a new Python file in Pycharm, edit some code that does not conform to PEP8 style, and put the mouse in the editor of the file → right button →external tools→ click Autopep8. So your code fits the PEP8 style. As shown in the following figure

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.