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

后端 未结 3 1147
佛祖请我去吃肉
佛祖请我去吃肉 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:56

    I also went with the command line:

    import os
    os.system(r'%windir%\system32\rundll32.exe powrprof.dll,SetSuspendState Hibernate')
    

提交回复
热议问题