Skip to content

Instantly share code, notes, and snippets.

@lodestone
Created May 11, 2018 20:07
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 lodestone/7fc7da3d9ae44ec700ef7b64fe9339c9 to your computer and use it in GitHub Desktop.
Save lodestone/7fc7da3d9ae44ec700ef7b64fe9339c9 to your computer and use it in GitHub Desktop.
#! python3
# smwtimer2.py - A simple countdown script.
# Using datetime
import time, datetime
from subprocess import call
call(["ls", "-l"])
pomStart = datetime.datetime.now()
pomTime = datetime.timedelta(minutes=25)
pomEnd = pomStart + pomTime
print("pomStart: " + str(pomStart))
print("pomTime: " + str(pomTime))
print("pomEnd: " + str(pomEnd))
pomLeft = pomEnd - pomStart
pomSec = datetime.timedelta(seconds=1)
while datetime.datetime.now() < pomEnd:
call("clear")
print("pomStart: " + str(pomStart))
print("pomTime: " + str(pomTime))
print("pomEnd: " + str(pomEnd))
print(pomLeft)
time.sleep(1)
pomLeft = pomLeft - pomSec
print("POM DONE!!!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment