Re: [python-win32] Unable to detect shutdown

2022-03-09 Thread Antoine FERRON via python-win32
I would recommend that you work with an object from a class, and using def __del__(self): I think when Windows shutdown, it send a stop/quit signal to all processes. When your Python is stopped by the OS, it can stop gracefully, and write the info in the file to backup, before it dies. This

Re: [python-win32] Unable to detect shutdown

2022-03-09 Thread Eryk Sun
On 3/9/22, H.Fujii wrote: > I'm currently developing a console program in Python 3.9. > I want to detect the shutdown of Windows and save the data to a file > safely. > I created a sample program by referring to the following URL. >

[python-win32] Unable to detect shutdown

2022-03-09 Thread H.Fujii
I'm currently developing a console program in Python 3.9. I want to detect the shutdown of Windows and save the data to a file safely. I created a sample program by referring to the following URL. https://docs.microsoft.com/en-us/windows/console/registering-a-control-handler-function However,