(2.0 only) The atexit
module allows you to register one or more functions
that are called when the interpreter is terminated.
To register a function, simply call the register
function, as shown in Example 1-78. You can also add one or more extra arguments, which are
passed as arguments to the exit
function.
This module is a straightforward wrapper for the sys.exitfunc
hook.
Get Python Standard Library now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.