Suspend / Hibernate pc with python

后端 未结 7 1416
庸人自扰
庸人自扰 2021-01-19 02:01

I\'d like to write a short python script that puts my computer to sleep. I\'Ve already searched the API but the only result on suspend has to do with delayed execution. What

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-19 02:52

    You can run shell command from python script. See subprocess module and then search for appropriate command for your operating system.

提交回复
热议问题