我想知道我是否可以在计算机休眠之前启动 python 程序中的函数或方法,这与
def f():
if about_to_sleep:
do_stuff
else:
do_some_other_stuff
可以在 windows 10 中运行
最佳答案
如果您不介意编写一个在后台运行的小型 C++ 应用程序,它可以在检测到计算机进入休眠状态时调用您的 python 脚本。
关于Python检测Windows 10中的 sleep 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42650968/