Skip to content

Instantly share code, notes, and snippets.

@djalmabright
Forked from thearn/capture.py
Created April 9, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djalmabright/1cefd87a3bad4326015eaa12d5807ce2 to your computer and use it in GitHub Desktop.
Save djalmabright/1cefd87a3bad4326015eaa12d5807ce2 to your computer and use it in GitHub Desktop.
Screen capture using python PIL
import time
import Image
import ImageGrab
while True:
time.sleep(0.5)
t = str(time.time()).replace('.','-')
tt = time.time()
img=ImageGrab.grab()
img = img.resize((800,600))
img.save(''.join(['img\\',t,'.png']))
print time.time() - tt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment