Doug’s just published a new PyMOTW, this one I didn’t know about - the “atexit” module.
The atexit module defines a single function to register cleanup functions. Functions thus registered are automatically executed upon normal interpreter termination.
I’m sorta kicking myself now for not knowing that was there. Man.
See Doug’s write up here: Doug Hellmann: PyMOTW: atexit
(Via Planet Python.)
Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment