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