Created
October 17, 2020 14:55
-
-
Save Quickz/9bd3ee7f3ca3b5732382ff15abfc9a5e to your computer and use it in GitHub Desktop.
Script that makes a screen shot every 5 seconds using a Windows feature
This file contains hidden or 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
# "pip install pynput" to install pynput | |
from pynput.keyboard import Key, Controller | |
from time import time, sleep | |
def take_screenshot(): | |
keyboard = Controller() | |
# Windows key + Print screen | |
with keyboard.pressed(Key.cmd_r): | |
keyboard.press(Key.print_screen) | |
keyboard.release(Key.print_screen) | |
interval = 5; | |
while True: | |
sleep(interval - time() % interval) | |
take_screenshot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment