Posts Tagged ‘reindent’

Reindent a source file

May 7, 2011 2 comments


You have a source file that you want to work with but it mixes tabs and spaces. The interpreter eats the file but it’s a nightmare to work with. How to correct it?


Fortunately, the standard installation comes with a handy utility called ““. You can find it with “locate“.


It will make a backup ( of the original file and overwrite The new will be indented correctly with 4 spaces everywhere.

Update (20120814)
If you don’t find, it is located here: /usr/share/doc/python2.7/examples/Tools/scripts/

You might have to install the package “python-examples” to have it.

Categories: python Tags: , , ,