Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python在windows10中检测睡眠模式_Python_Windows_Python 3.x - Fatal编程技术网

Python在windows10中检测睡眠模式

Python在windows10中检测睡眠模式,python,windows,python-3.x,Python,Windows,Python 3.x,我想知道我是否可以在计算机睡眠前在python程序中启动函数或方法,这是一种类似于 def f(): if about_to_sleep: do_stuff else: do_some_other_stuff 可以在Windows 10 < P>中工作。如果你不介意编写一个小型C++应用程序在后台运行,它可以在检测到计算机进入睡眠时调用你的Python脚本。 看看: 这是一个与您的问题类似的问题,但可能仍然相关。到目前为止您尝试过什么吗?可能是

我想知道我是否可以在计算机睡眠前在python程序中启动函数或方法,这是一种类似于

def f():
    if about_to_sleep:
        do_stuff
    else:
        do_some_other_stuff

可以在Windows 10

< P>中工作。如果你不介意编写一个小型C++应用程序在后台运行,它可以在检测到计算机进入睡眠时调用你的Python脚本。 看看:


这是一个与您的问题类似的问题,但可能仍然相关。

到目前为止您尝试过什么吗?可能是重复的