[Tutor] Examples of "With....As Statement" in Python

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Jul 10 17:25:09 CEST 2012


On 10/07/2012 15:58, James Bell wrote:
> I'm attempting to learn how to use the "with....as" statement in python.
>
> I've read the documentation and also a few tutorials but I still cannot
> understand the concept. or how this is normally used. Can someone please
> write an example or 2 of simple ways to use the "with statement".
>
> I understand in java the try...catch...finally block so maybe someone can
> point out the relationship between them.
>
> thanks.
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

You're not the only one, see this 
http://effbot.org/zone/python-with-statement.htm

-- 
Cheers.

Mark Lawrence.





More information about the Tutor mailing list