"Getting Started with machine learning--2" Pycharm installation Autopep8

Source: Internet
Author: User

To be good, its prerequisite.

When writing a Python program with Pycharm, often encounter more than one of the Python whitespace problem (pycharm requirements of the more stringent), so there will be a warning, there will be a wavy line generated, seriously affecting the program's aesthetic degree.

But manual layout is a hassle, so you have to have an automatic typesetting tool (AUTOPEP8 is one such artifact).

AUTOPEP8 is a gadget that automatically typeset python code into PEP8 style. It uses the PEP8 tool to determine which part of the code needs to be typeset. AUTOPEP8 can fix the layout problems reported in most PEP8 tools. The tool can also be used in Linux environments (this article does not mention Linux environments only consider Win7 64-bit)


Installation and configuration steps:

1. Installing AUTOPEP8

Open Computer cmd, enter pip install AUTOPEP8 enter OK wait for download installation complete

Because my computer is already installed, the result is as shown.


2: Configure AUTOPEP8 to Pycharm


          Open Pycharm→file→settings→tools→extends tools→ add


        A:NAME:AUTOPEP8 (can be taken anywhere)


        Important configuration begins:


      b:tools settings


          PROGRAMS:AUTOPEP8 (provided that you have Installed OH)
          Parameters:--in-place--aggressive--aggressive $FilePath $


          working directory: $ProjectFileDir $


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


3:AUTOPEP8 in Pycharm: Create a new Python file in Pycharm Edit, edit some code that does not conform to the PEP8 style, and place the mouse in the editor of the file → right-click →external tools→ tap Autopep8. This way your code will fit into the PEP8 style. As shown in



"Getting Started with machine learning--2" Pycharm installation Autopep8

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.