Shutdown hook

Steve steve.morin at
Tue Nov 15 23:45:27 CET 2005

Does any one know if python has the ability to run a shutdown hook.

For example you set a method to run when the python process is shutting
down, like it recieved a kill signal?

Basically looking for an effect like the following java code.
Runtime.getRuntime().addShutdownHook(new Thread(this));

More information about the Python-list mailing list