231
|
In python the
with keyword is used when working with unmanaged resources (like file streams). It is similar to the using statement in VB.NET and C#. It allows you to ensure that a resource is "cleaned up" when the code that uses it finishes running, even if exceptions are thrown. It provides 'syntactic sugar' for try/finally blocks.
From Python Docs:
|
jueves, 25 de enero de 2018
Python with statement
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario