Created
June 2, 2018 21:35
-
-
Save kairat-beep/11534729398d09fbfb0aaccb4723c260 to your computer and use it in GitHub Desktop.
screen shot saving script that takes every 1 sec. Used to capture changing frames.
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
import winsound | |
from time import sleep | |
import pyscreenshot as ImageGrab | |
if __name__ == '__main__': | |
i = 0 | |
try: | |
while True: | |
Freq = 100 # Set Frequency To 2500 Hertz | |
Dur = 50 # Set Duration To 1000 ms == 1 second | |
winsound.Beep(Freq,Dur) | |
# grab fullscreen | |
im = ImageGrab.grab() | |
# save image file | |
im.save('screenshot {}.png'.format(i)) | |
i+=1 | |
# show image in a window | |
#im.show() | |
sleep(1) | |
except KeyboardInterrupt: | |
print("You stopped loop") | |
#-# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment