Il 2005-11-15, Ben Finney <[EMAIL PROTECTED]> ha scritto: > Steve <[EMAIL PROTECTED]> 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 - http://docs.python.org/lib/module-atexit.html is cleaner -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the end of the tunnel for most of his problems is Python" -- http://mail.python.org/mailman/listinfo/python-list