always raise syntax error!

Larry Bates larry.bates at websafe.com
Fri Oct 13 10:59:12 EDT 2006


daniel wrote:
> thank you so much for the reply.
> 
> I finally re-type all the codes where python would raise syntax error,
> then fixed. I did not examine every single word of my old codes though,
>  there might be some parenthesis not matching somewhere, I guess.
> 
> well, I would say, the reason why I could not position the error code
> may partly due to the ambiguous message that python provides. the lines
> that python pointed to contains no error,  I think the error codes must
> be too far away from there. anyway, I hope python would make more
> detailed error messages, like c++ compilers do. such as: "missing ;" or
> "(" not matching...etc.
> 
> tks again..
> 
> daniel
> 
What Steve is trying to tell you is that you need to copy/paste your
code (with the full traceback) in future messages.  We are not mind
readers out here.

Occassionally I will have phantom syntax errors that seem to be
attributable to non-printing characters in a line.  Other times the
error is in fact far above the place pointed to by the syntax error.
Start by commenting out large chunks of code with triple quotes and
slowly work towards the lines with a problem.

-Larry Bates



More information about the Python-list mailing list