Skip to content

Instantly share code, notes, and snippets.

@M0Rph3U56031769
Created December 22, 2020 07:57
Show Gist options
  • Save M0Rph3U56031769/b1a17baa74f778819b50cfde69ba8217 to your computer and use it in GitHub Desktop.
Save M0Rph3U56031769/b1a17baa74f778819b50cfde69ba8217 to your computer and use it in GitHub Desktop.
prevent screensaver/lock screen
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