Python Indentation Problems

gene tani gene.tani at gmail.com
Mon Feb 27 02:21:08 EST 2006


diffuser78 at gmail.com wrote:
> I am a newbie to Python. I am mainly using Eric as the IDE for coding.
> Also, using VIM and gedit sometimes.
>
> I had this wierd problem of indentation. My code was 100% right but it
> wont run because indentation was not right. I checked time and again
> but still no success. I rewrote the code over again in VI and it ran.
>
> Can you please explain whats the trick behind the correct indentation.
>

These aren't really tricks or secrets:

http://www.python.org/doc/essays/styleguide.html
http://www.logilab.org/projects/pylint/documentation

Different editors, e.g. komodo and textmate, let you look at tabs and
spaces graphically
And avoid pasting other peoples' code into your modules.  Keep them in
separate modules




More information about the Python-list mailing list