First, what is PEP8?
Second, pycharm in the configuration Pep8
Pycharm
There is a pep8
style test in itself, and when you do not conform to the specification in the code, there will be a wavy line hint. How do you change the code to conform to the specification and remove these unsightly wave floss? Here are the steps:
2.1 Installing AUTOPEP8
CMD window input:pip install autopep8
2.2 Installing the AUTOPEP8 configuration in Pycharm
650) this.width=650; "src=" Https://segmentfault.com/img/bVyzik "style=" border:1px solid rgb (221,221,221); vertical-align:middle;padding:3px; "alt=" Bvyzik "/>
NAME:AUTOPEP8 (can be taken casually)
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: Code style= "font-family: ' Source code Pro ', Consolas, Menlo, Monaco, ' Courier New ', Monospace;font-size:.93em;color:rgb ( 199,37,78); Background-color:rgb (249,242,244);p adding:2px 4px; " > $FILE _path$\: $LINE $\: $COLUMN $\:.*
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
650) this.width=650; "src=" HTTPS://SEGMENTFAULT.COM/IMG/BVYZJQ "style=" border:1px solid rgb (221,221,221); Vertical-align:middle;padding:3px;color:rgb (51,51,51); font-family: ' Helvetica Neue ', Helvetica, Arial, ' Pingfang SC ' , ' Hiragino Sans GB ', ' Wenquanyi Micro Hei ', ' Microsoft Yahei ', sans-serif;font-size:14px;white-space:normal; Background-color:rgb (255,255,255); "alt=" BVYZJQ "/>
This article is from the "tcollaboration" blog, make sure to keep this source http://tcollaboration.blog.51cto.com/6328404/1875663
Pycharm Configuring the Autopep8 tutorial to make Python code more compliant with the PEP8 specification