I have some Python code that have inconsistent indentation. There is a lot of mixture of tabs and spaces to make the matter even worse, and even space indentation is not pre
autopep8 -i script.pyUse autopep8
autopep8 automagically formats Python code to conform to the PEP 8
nullstyle guide. It uses the pep8 utility to determine what parts of the
nullcode needs to be formatted. autopep8 is capable of fixing most of the
nullformatting issues that can be reported by pep8.
pip install autopep8
autopep8 script.py # print only
autopep8 -i script.py # write file