OS Reboot, Shutdown, Hibernate, Sleep, Wakeup (Windows Python)

后端 未结 3 1115
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 09:25

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 th

3条回答
  •  走了就别回头了
    2021-01-18 09:42

    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 usectypessince looks like pywin32 does not implement it.

    Wakeup? I doubt you can execute code while sleeping. :)

提交回复
热议问题