PyCharm
 
Get PyCharm
You are viewing the documentation for an earlier version of PyCharm.

Reformat and rearrange code

Last modified: 08 September 2023

PyCharm lets you reformat your code according to the requirements you've specified in your current code style scheme or the .editorconfig file. If anything is not defined in .editorconfig, it is taken from the project settings.

You can reformat a part of code, the whole file, group of files, a directory, and a module. You can also exclude part of code or some files from the reformatting. PyCharm adheres to PEP8 rules and requirements for arranging and formatting Python code.