Wake Windows PC from sleep in Python 2.7

后端 未结 2 1468
有刺的猬
有刺的猬 2021-01-22 07:35

I have a script that will put the system to sleep in the middle of it. Is there any way to make that script wake the system up and then continue running?

I have read man

2条回答
  •  执念已碎
    2021-01-22 07:56

    I was unable to accomplish this using just python. However in the Windows SDK they provide a tool called pwrtest that will allow you to do timed sleep cycles. I am able to call this with python and then my script continues when pwrtest wakes the PC up from sleep.

提交回复
热议问题