Skip to content

Instantly share code, notes, and snippets.

@dudarev
Created June 3, 2014 09:34
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 dudarev/8d098de7c1a96ba158ca to your computer and use it in GitHub Desktop.
Save dudarev/8d098de7c1a96ba158ca to your computer and use it in GitHub Desktop.
Take screenshots regularly
#! /usr/bin/env python
"""
Take screenshots every SLEEP_TIME seconds.
"""
import time
import subprocess
SLEEP_TIME = 10
COMMAND = "import -window root -format png data/{timestamp}.png"
while True:
ts = int(time.time())
print ts
subprocess.call(COMMAND.format(timestamp=ts), shell=True)
time.sleep(SLEEP_TIME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment