Unexpected exit of Python script

Mick Krippendorf mad.mick at gmx.de
Wed Oct 14 08:58:32 EDT 2009


vicky schrieb:
> Actually In my system I want to execute some piece of code at the time
> of script exit (expected or unexpected) to ensure the release of all
> the resources. I don't know how to do that :(

You maybe want to use a context manager. Look for 'with statement' and
'contextlib' in your docs.


HTH,
Mick.



More information about the Python-list mailing list