atexit — Program Shutdown Callbacks — PyMOTW 3

The atexit module provides an interface to register functions to be called when a program closes down normally.

Read more…

This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.