I would like to clean a long Python code:
indentations (sometimes I used 2 whitespaces, sometimes 4 whitespaces), I would like to have 4 everywhre
sometimes I have some unwanted whitespaces at the end of a line like this :
print "hello" <EOL>
Using Sublime Text's Edit > Line > Reindent just doesn't work for Python. Example: doing it on:
for i in range(27):
if a == b:
print a
print "finished"
would give
for i in range(27):
if a == b:
print a
print "finished"
which is not the same thing!
What do you use to beautify your Python code?
you can use autopep8 to do this : https://pypi.python.org/pypi/autopep8/