Shutdown hook

Lawrence Oluyede raims at
Wed Nov 16 00:08:40 CET 2005

Il 2005-11-15, Ben Finney <bignose+hates-spam at> ha scritto:
> Steve <steve.morin at> wrote:
>> Does any one know if python has the ability to run a shutdown hook.
> When the Python runtime system wants to exit, it raises a SystemExit
> exception.
> Catch that exception at the top level of your code, and do whatever
> you like. (It might be polite to actually exit at some point, of
> course. sys.exit(exitcode) will do so -- raising another SystemExit
> exception.)

I think using atexit module - is cleaner

Lawrence -
"Anyone can freely use whatever he wants but the light at the end
of the tunnel for most of his problems is Python"

More information about the Python-list mailing list