Question about using "with"

Laszlo Nagy gandalf at designaproduct.biz
Tue Jan 9 13:25:35 EST 2007


>
> 591 > ./cat.py cat.py
>    File "./cat.py", line 6
>      with open(sys.argv[nn]) as f:
>              ^
> SyntaxError: invalid syntax
> 592 >
>
> This example came from http://docs.python.org/tut/node10.html down in 
> section 8.7
>
> Am I missing something?
>   
Are you using python 2.5? The with statement is not available before 2.5.

   Laszlo




More information about the Python-list mailing list