Python Newbie

Brian van den Broek broek at cc.umanitoba.ca
Thu Feb 8 18:02:43 EST 2007


spazziam said unto the world upon 02/08/2007 04:18 PM:
> SyntaxError: invalid syntax
>   File "C:\Python23\vdrop2\final py\vdrop2.py", line 123
>     def INIT_HIGHS():
>       ^
> SyntaxError: invalid syntax
> 
> Why would this come up?
> 

Hi,

Most likely, a previous line contains an unfinished statement. For 
instance:

not_yet_a_list = [1,2,3

def foo():
     pass

when saved and run as foo.py produces:

brian at gottlob:~/scratch$ python foo.py
   File "foo.py", line 3
     def foo():
       ^
SyntaxError: invalid syntax

HTH,

Brian vdB





More information about the Python-list mailing list