Created
June 19, 2014 19:42
-
-
Save kavon/d970c4138712021ceedd to your computer and use it in GitHub Desktop.
Tea Steeping Timer
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
#!/usr/bin/env python | |
from Tkinter import * | |
import tkMessageBox | |
import sys | |
import time | |
window = Tk() | |
window.wm_withdraw() | |
# because I'm not wasting my time making a nice input window in tk :) | |
value = raw_input("For how many minutes would you like to steep your tea? ") | |
try: | |
value = float(value) | |
except ValueError: | |
print " **** That's not a valid number. **** " | |
sys.exit(1) | |
print "\n\n\t Okay, I'll let you know when it's done. You can minimize this." | |
time.sleep(60 * value) | |
window.geometry("1x1+" + str(window.winfo_screenwidth()/2) + "+" + str(window.winfo_screenheight()/2)) | |
tkMessageBox.showinfo(title="Tea Timer", message="Your tea is done!", icon='info') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment