title: How to run one last function before getting killed in Python?
body: <p>Is there any way to run one last command before a running Python script is stopped by being killed by some other script, keyboard interrupt etc.</p>