[Tutor] finally without try or except

Tino Dai oberoc at gmail.com
Mon Jul 30 21:10:08 CEST 2012


On Mon, Jul 30, 2012 at 1:52 PM, Mark Lawrence <breamoreboy at yahoo.co.uk>wrote:

> On 30/07/2012 17:56, Tino Dai wrote:
>
>> Hi!
>>
>>       Is there anyway to execute a block of code at the end of a program
>> in
>> 2.6 regardless of what happened before eg exiting normally or died because
>> of an exception?
>> I was thinking about maybe a free standing finally code block or a
>> decorator.
>>
>> Any hints?
>> Tino
>>
>>
>>
>> ______________________________**_________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor>
>>
>>
> Sorry I'm not completely sure what you're asking for but will this help
> http://docs.python.org/**library/atexit.html<http://docs.python.org/library/atexit.html>?
>
> I think this might be what I'm looking for. But for about 2 minutes, I was
like a-texit....what does that have to do with....oooohhhh it's at exit.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120730/26e3abbc/attachment.html>


More information about the Tutor mailing list