Skip to content

Instantly share code, notes, and snippets.

@EvelynSubarrow
Last active February 22, 2020 23:16
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 EvelynSubarrow/a0ddf8f9c75ca8e460800cee8d8999c6 to your computer and use it in GitHub Desktop.
Save EvelynSubarrow/a0ddf8f9c75ca8e460800cee8d8999c6 to your computer and use it in GitHub Desktop.
Inside you are two clocks, one system and one real time,,
#!/usr/bin/env python3
import argparse, time, datetime, os
parser = argparse.ArgumentParser()
parser.add_argument("command", )
args = parser.parse_args()
while True:
t1 = datetime.datetime.now()
time.sleep(1)
t2 = datetime.datetime.now()
if (t2-t1).seconds>10:
os.system(args.command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment