I would like to know how to "cleanly" finish the execution of a python application on Windows shutdown.
My application starts at startup, opens a text file and keeps running while Windows is on, What I want to do is to, somehow, capture the shutdown signal and inmediately stop the processes running and close the text file with the io method myFile.close()
, finishing the program by itself, and not forced by Windows. Any idea about how that could be done?
Thank you in advance.
Regards
Asked
Active
Viewed 310 times
2

Half_Bit
- 103
- 1
- 7