[python-win32] How to find the current/last system state from Python

prashant padaganur prashantpadaganur at gmail.com
Fri Jul 6 13:30:32 CEST 2012


>>prashant padaganur wrote:
>>**>>* Tim this might be something similar, but what I am looking for is*>>* sleep state. I want the exact api which exposes/returns the*>>*  SYSTEM_POWER_STATE enum either thru win32ap or wmi.*
>It's a little difficult to figure out what you want.  When the system
>goes into a sleep state, user mode applications stop running.  If you
>are writing a command to change the current power state, then you may
>safely assume that the system is in S0.  Otherwise, your command could
>not have been started.

>There are only two possible transitions:  from working (S0) to a
>sleeping state (S1-S5), and from a sleeping state to working (S0).  The
>operating system will not go from standby directly to hibernate; it has
>to make an intermediate stop in S0.

>http://www.osronline.com/ddkx/kmarch/pwrmgmt_919j.htm

Thanks Tim. But when the system is in S0 state I want to read that
information from the system.

May be as suggested I can try getting the previous states from Windows
event logger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120706/6e534742/attachment.html>


More information about the python-win32 mailing list