Win XP "Sleep" mode: can Py wake up?

Tim Golden tjgolden at gmail.com
Fri Jan 26 15:49:25 CET 2007


> Does anyone have any experience having python deal with sleep mode?  I'd
> love to run something that would hear a sleep event coming and pickle
> some data before sleep, then after coming out of sleep, unpickle...

It should, in theory, be possibly by trapping the WMI
Win32_PowerManagementEvent event. I haven't time
to try it out at the moment, unfortunately. Alternatively,
the WM_POWERBROADCAST message looks hopeful
if you wanted to go the Message Loop route.

TJG




More information about the Python-list mailing list