I have a some .py files that use spaces for indentation, and I'd like to convert them to tabs.
I could easily hack together something using regexes, but I can think of several edge cases where this approach could fail. Is there a tool that does this by parsing the file and determining the indentation level the same way the python interpreter does?