So, I have a script that needs to "clean up" when it is exited: it needs to clear a special logging file and other small things that affect the next startup of the script. The script has a GUI written in Tkinter, if that is relevant at all.
Is there any way to run some "cleanup code" regardless of how the script is exited?
Thanks in advance.