I'm looking for an automatize way of doing Windows Power Management functions: - Reboot - Shutdown - Hibernate - Sleep - Wakeup
Is there a Python module to cover this functionality? Of course any other solutions are also appreciated...
I also went with the command line:
import os
os.system(r'%windir%\system32\rundll32.exe powrprof.dll,SetSuspendState Hibernate')
See win32api.ExitWindowsEx()
ActiveState documentation.
for flags: http://msdn.microsoft.com/en-us/library/aa376868%28v=vs.85%29.aspx
for hybernate/sleep:
http://msdn.microsoft.com/en-us/library/aa373201%28v=vs.85%29.aspx
to use this one you need to usectypes
since looks like pywin32
does not implement it.
Wakeup? I doubt you can execute code while sleeping. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With