How about you just isolate the first few lines

On Thu, Jan 14, 2010 at 2:43 PM, Ray Holt <mrhol...@sbcglobal.net> wrote:
> try:
>     #open file stream
>     file = open(file_name, "w"
> except IOError:
>     print "There was an error writing to", file_name
>     sys.exit()

Notice anything now? Something missing perhaps.

You forgot to close the parenthesis for the open. Python moves on to
the next line to look for where you close the call, and sees an except
which is illegal inside of a function call.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to