I have a program that requires some cleaning up after exiting, and have written a seperate .py file for this. However, the program I use stays in an infinite loop at one part:
pythoncom.PumpMessages()
Because of this, there is no "natural" closing of the program. The only way is to end the process from task manager.
So I ask: is there a way to, upon being ended from task manager, to run my clean up python script automatically?
Edit: I could put it in an infinite loop in a different way, such as this, if it helps:
while True:
pythoncom.PumpWaitingMessages()