Is there a tool for automatically formatting Python code?

Something similar to Visual Studio formatting options, which allow spaces in empty method calls, the distance before and after the element access statement . etc. For instance:

from

 verts()[i].setPosition(x,y,z) 

in

 verts ( )[ i ].setPosition ( x, y, z ) 

I saw several links on the Internet, but they seem to be out of date.

Also looking for a GUI tool.

+4
source share
2 answers

The PyCharm IDE has a code formatting feature and is customizable for a coding style or project.

In September 2013, JetBrains released the PyCharm news release; which supports these features.

The paid version adds tools specifically for web development, such as support for Django, CSS, HTML and JavaScript.

+4
source

I use Komodo myself, but many editors format Python code. You can look at this entry: What IDE to use for Python?

+1
source

Source: https://habr.com/ru/post/1388774/


All Articles