On 26 Feb 2006 22:21:26 -0800 [EMAIL PROTECTED] 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.
I'm not sure about Eric, but I found that when using the Python interpreter through a terminal window, it's often confusingly fastidious about tabs versus spaces. You would think that in an interactive context the interpreter would be smart enough to fix these errors on input (e.g. by implementing a "convert tabs to spaces" policy by default -- I've already configured my gvim editor to do that, and while it's not obviously the right thing to do in an editor it seems like a no-brainer for an editing mode whose only purpose is to run Python), but it apparently doesn't (or didn't anyway -- either I've gotten better about not mixing them, or it may have been fixed, or else I'm just lucky to finally have a terminal that agrees with the interpreter on the width of tabs). In any case, it's good practice not to mix tabs and spaces. I actually recommend using just tabs when playing with the interpreter (it's faster) -- but use spaces in your real source code files. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list