user208685
user208685

Reputation: 131

Python detect sleep mode in windows10

I want to find out if I can launch a function or a method in a python program right before the computer sleep, something that goes along the line of

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

that can work in windows 10

Upvotes: 2

Views: 2674

Answers (0)

Related Questions