You always write Python code does not regulate? Use it!

Today, we say it

Code style

 

 

Different programming languages

There are different coding style

 

 

 

 

 

 

 

 

 

 

 

 

 

Python code specifications

Is often said PEP8

 

 

 

 

 

On this site

https://www.python.org/dev/peps/pep-0008/#introduction

 

 

It describes all of the code style guide

Heard by its style to write code

You can understand the Zen of Python

To not try?

 

 

 

 

 

Someone opened the pages PEP8

one look

 

 

 

 

So many things devil

Who special What remember?

 

 

 

 

 

 

Wait

Today to introduce you to the artifact

 

autopep8

 

This is a command tool

Whether you write more bad coding style

 

It can help you

Automatic style formatted code PEP8

 

 

 

 

 

As an example of official

In the absence of use autopep8

Such a sub-code

 

 

 

 

After using autopep8

 

 

 

 

There is no comparable plastic surgery!

 

 

 

 

 

 

You can not buy a disadvantage

Also can not buy fooled

 

 

Free Open Source

As long as you have installed will be able to use

 

 

Installation wave

 

 

 

Use a wave

 

 

 

Finally, say a

When you use Pycharm

It is not often have these small lumps

 

 

 

 

This is because your code does not comply with PEP8

Or try to use this shortcut key

 

CTRL+ALT+L

 

 

 

 

 

 

ok, above

So next time we see

Guess you like

Origin www.cnblogs.com/7758520lzy/p/12214234.html