How to use pycharm to auto indent the select area by the template of the coding style
That action is called Reformat code
. You can find it in Code
menu, somewhere in the middle, or use the hotkey CTRL + Shift + L
The latest version of PyCharm uses CTRL + SHIFT + ALT + L in both Linux and Windows. Then from the reformat dialog box, choose what reformatting option you want to perform.
CTRL + Shift + L will reformat your code.