I have a Python application that regularly dies when the computer goes to sleep. It works well on Mac, Windows and Linux on it's own, but the sleep problem is irritating.
Is there a function/library that would let me deal with sleep mode in a platform independant way?
Something like
if(OSSLEEP){
#Reduced Functionality
}
I would be happy if the program simply didn't crash, as I realize it is probable that no functionality is possible during sleep.
I researched the question: How can I check to see if system is in standby mode?
It seems there is a Win32 API function which does this: By this reasoning there might be a Python library that does the same thing. Notification when Windows enters in sleep mode
This seems to say it's not possible and a bad idea: Multithreaded python urllib2-based downloader drives the computer to Standby/Sleep
I would love to know if this is do-able even if it's not advisable.