PythonTidy
Roberto Bonvallet
Roberto.Bonvallet at cern.ch
Thu Nov 30 08:21:55 EST 2006
Chuck Rhode wrote:
> I couldn't find a routine to clean up, regularize, and reformat Python
> code, so I wrote one:
>
> http://www.lacusveris.com/PythonTidy/PythonTidy.python
>
> Now, I'm looking for beta-testers. Compensation is a bit on the low
> side. In fact it's limited to the satisfaction of helping out.
$ cat test.py
#!/usr/bin/env python2.5
# vim: set fileencoding=utf-8 :
for i in xrange ( 3) :
print i
$ python2.5 PythonTidy.python < test.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
for i in xrange(3):
print i
About changing the shebang line: I'll take it as a bug.
About changing the encoding declaration from vim-style to emacs-style:
I'll take it as an insult :)
Both are comments, and should be left that way. Besides, there is no
officially preferred way for each of them. BTW, in a recent thread on
this newsgroup, most people said they preferred #!/usr/bin/env python over
#!/usb/bin/python for the shebang line. See http://tinyurl.com/yngmfr .
Best regards.
--
Roberto Bonvallet
More information about the Python-list
mailing list