Created
May 11, 2018 20:06
-
-
Save lodestone/280d35c8482e33302042b6841bd4c3c9 to your computer and use it in GitHub Desktop.
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
#! 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