[Tutor] IDLE error msgs and line continuations?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Oct 29 23:15:02 CEST 2005



On Thu, 27 Oct 2005, CPIM Ronin wrote:

> When using IDLE, after hitting F5 to save and run, if an error occurs,
> it merely flashes at the code location of the error. While I usually
> figure out what is wrong, why don't I get the detailed text error
> messages that the command line gives?
>
> Also, I'm getting most error messages when I try line continuation for
> clarity:
>
>      if (condition 123 and
>          condition 456):

Hi RC,

It might be the case that 'condition 123' is malformed.  If this is true,
then the problem doesn't stem from going across lines, but with the
'condition 123' and 'condition 456' stuff.

Just to check:

######
>>> if (condition 123 and
  File "<stdin>", line 1
    if (condition 123 and
                    ^
SyntaxError: invalid syntax
######

Yeah, looks like Python immediately seizes on that part and stops at the
point where the SyntaxError is.  It doesn't even wait for me to enter in
the rest of the line.

I'm not sure if this is the real error that you're seeing; you may have
just used 'condition 123' simply as an example.  If you have code that you
can show us, we'll look at it more carefully.


Best of wishes to you!



More information about the Tutor mailing list