Python atexit exit handle - like the END block of Perl
The word Postmoretem is used in several context. One is the when a (software development) project was finished. Wikipedia describes it as Postmortem documentation.
It is a very useful technique to lear from all the good and bad that happened during the project.
Python provides a way to do a sort of a "post mortem" of a Python program after it exits. Even if it exited in a very exceptional way.
Perl programmers might be familiar with the concept using an END block.
Python provides a module called atexit
That is, you can designate a function (or more functions) to be execute after your script called exit(), fall out at the end of the file, or even raised an uncaught exception, just before python exits.
Here is an example how to use it:
Published on 2019-07-19