Prev: timeit function
Next: Merging two dictionaries
From: rechardchen on 1 Aug 2010 21:17 I'm writing a python script which runs as a windowsxp service. The problem is how to catch the windows shutdown/reboot message and do some cleaning job when system is going down? The atexit module and signal module on windows dont seems to work. I guess the python win32api may be of help, but I am not familiar with it... Thank you
From: Tim Golden on 2 Aug 2010 04:00 On 02/08/2010 02:17, rechardchen wrote: > I'm writing a python script which runs as a windowsxp service. > The problem is how to catch the windows shutdown/reboot message and do > some cleaning job when system is going down? > > The atexit module and signal module on windows dont seems to work. I > guess the python win32api may be of help, but I am not familiar with it... > Thank you Have a look at the SENS stuff: http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html TJG
From: rechardchen on 2 Aug 2010 08:31 δΊ 2010-8-2 16:00, Tim Golden ει: > On 02/08/2010 02:17, rechardchen wrote: >> I'm writing a python script which runs as a windowsxp service. >> The problem is how to catch the windows shutdown/reboot message and do >> some cleaning job when system is going down? >> >> The atexit module and signal module on windows dont seems to work. I >> guess the python win32api may be of help, but I am not familiar with >> it... >> Thank you > > Have a look at the SENS stuff: > > http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html > > TJG Thanks, the extended handler functionality works. :)
|
Pages: 1 Prev: timeit function Next: Merging two dictionaries |