Created
December 22, 2020 07:57
-
-
Save M0Rph3U56031769/b1a17baa74f778819b50cfde69ba8217 to your computer and use it in GitHub Desktop.
prevent screensaver/lock screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import windll | |
# prevent screensaver/lock screen | |
windll.kernel32.SetThreadExecutionState(0x80000002) | |
# restore state | |
windll.kernel32.SetThreadExecutionState(0x80000000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment