Skip to content

Instantly share code, notes, and snippets.

@kavon
Created June 19, 2014 19:42
Show Gist options
  • Save kavon/d970c4138712021ceedd to your computer and use it in GitHub Desktop.
Save kavon/d970c4138712021ceedd to your computer and use it in GitHub Desktop.
Tea Steeping Timer
#!/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