help: code formatter?

S

siggi

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
 
B

Bjoern Schliessmann

siggi said:
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
 
T

Thomas Heller

siggi said:
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
 
B

Bjoern Schliessmann

siggi said:
Bjoern wrote:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top