To install reindent using the python package manager, you can first run pip install reindent on your system. Then just call from the terminal
reindent -n file.py
script will change file.py
If you do not want to modify the source file, you can simply run the command without the -n flag and you will get:
reindent file.py
which will return a file called file.py.bak , which is a patched version.
source share