By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

help: code formatter?

P: n/a
Hi all,

as a newbie I have problems with formatting code of downloaded programs,
because IDLE's reformatting capabilities are limited . Incorrect
indentation, mixing of TAB with BLANKs or eol are often very nasty to
correct.
Is there a simple code formatter that first removes all indentations and
then refomats correctly?

Please help!

Thank you,

siggi


Jan 8 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
siggi wrote:
as a newbie I have problems with formatting code of downloaded
programs, because IDLE's reformatting capabilities are limited .
Incorrect indentation, mixing of TAB with BLANKs or eol are often
very nasty to correct.
Is there a simple code formatter that first removes all
indentations and then refomats correctly?
Why don't you just write one? :)

Seriously: Try.

BTW: Guessing to what amount of space TABs must be converted in
mixed source can be non-trivial.

Regards,
Björn

--
BOFH excuse #289:

Interference between the keyboard and the chair.

Jan 8 '07 #2

P: n/a
siggi schrieb:
Hi all,

as a newbie I have problems with formatting code of downloaded programs,
because IDLE's reformatting capabilities are limited . Incorrect
indentation, mixing of TAB with BLANKs or eol are often very nasty to
correct.
Is there a simple code formatter that first removes all indentations and
then refomats correctly?

Please help!

Tools\scripts\reindent.py in your Python distribution.

Thomas
Jan 8 '07 #3

P: n/a
siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100. My reply is below.
Is there a simple code formatter that first removes all indentations
and then refomats correctly?
Why, yes, there is:

http://lacusveris.com/PythonTidy/PythonTidy.python

--
... Chuck Rhode, Sheboygan, WI, USA
... 1979 Honda Goldwing GL1000 (Geraldine)
... Weather: http://LacusVeris.com/WX
... 26° — Wind W 17 mph

Jan 8 '07 #4

P: n/a
Bjoern wrote:
Why don't you just write one? :)
Very funny! Just learning Python :(

Regards,

siggi
siggi wrote:
>as a newbie I have problems with formatting code of downloaded
programs, because IDLE's reformatting capabilities are limited .
Incorrect indentation, mixing of TAB with BLANKs or eol are often
very nasty to correct.
Is there a simple code formatter that first removes all
indentations and then refomats correctly?

Why don't you just write one? :)

Seriously: Try.

BTW: Guessing to what amount of space TABs must be converted in
mixed source can be non-trivial.

Regards,
Björn

--
BOFH excuse #289:

Interference between the keyboard and the chair.

Jan 9 '07 #5

P: n/a
Thomas wrote:
Tools\scripts\reindent.py in your Python distribution.
Thank you Thomas!

What a bucket full of toolsin \tools! I didn't know that.

siggi
"Thomas Heller" <th*****@ctypes.orgschrieb im Newsbeitrag
news:ma***************************************@pyt hon.org...
siggi schrieb:
>Hi all,

as a newbie I have problems with formatting code of downloaded programs,
because IDLE's reformatting capabilities are limited . Incorrect
indentation, mixing of TAB with BLANKs or eol are often very nasty to
correct.
Is there a simple code formatter that first removes all indentations and
then refomats correctly?

Please help!


Tools\scripts\reindent.py in your Python distribution.

Thomas

Jan 9 '07 #6

P: n/a
Chuck wrote:
http://lacusveris.com/PythonTidy/PythonTidy.python
Wow, what a giant of a program! Trying to find out how this works.

Thank you,

siggi

"Chuck Rhode" <CR****@LacusVeris.comschrieb im Newsbeitrag
news:ma***************************************@pyt hon.org...
siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100. My reply is
below.
>Is there a simple code formatter that first removes all indentations
and then refomats correctly?

Why, yes, there is:

http://lacusveris.com/PythonTidy/PythonTidy.python

--
.. Chuck Rhode, Sheboygan, WI, USA
.. 1979 Honda Goldwing GL1000 (Geraldine)
.. Weather: http://LacusVeris.com/WX
.. 26° - Wind W 17 mph

Jan 9 '07 #7

P: n/a
"siggi" <sm***********@yahoo.comwrote:
Is there a simple code formatter that first removes all indentations and
then refomats correctly?
tabnanny ?

- Hendrik

Jan 9 '07 #8

P: n/a
>tabnanny?
not quite!

"Hendrik van Rooyen" <ma**@microcorp.co.zaschrieb im Newsbeitrag
news:ma***************************************@pyt hon.org...
"siggi" <sm***********@yahoo.comwrote:
>Is there a simple code formatter that first removes all indentations and
then refomats correctly?

tabnanny ?

- Hendrik

Jan 9 '07 #9

P: n/a
siggi wrote:
Bjoern wrote:
>Why don't you just write one? :)

Very funny! Just learning Python :(
It isn't funny at all. You'll learn by doing and trying things.
That's how all programmers start.

Regards,
Björn

--
BOFH excuse #265:

The mouse escaped.

Jan 9 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.