2

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

Half_Bit
  • 103
  • 1
  • 7

0 Answers0