Python invalid syntax with "with" statement

Posted by mrlanrat on Stack Overflow See other posts from Stack Overflow or by mrlanrat
Published on 2010-05-03T02:30:40Z Indexed on 2010/05/03 2:38 UTC
Read the original article Hit count: 407

Filed under:
|
|

Hello all,

I am working on writing a simple python application for linux (maemo). However I am getting SyntaxError: invalid syntax on line 23: with open(file,'w') as fileh:

The code can be seen here: http://pastebin.com/MPxfrsAp

I can not figure out what is wrong with my code, I am new to python and the "with" statement. So, what is causing this code to error, and how can I fix it? Is it something wrong with the "with" statement?

Thanks!

© Stack Overflow or respective owner

Related posts about python

Related posts about syntax