Created
March 3, 2018 22:06
-
-
Save chrisdodds/691f611bd7632acacdd6eeea35f0c8bd to your computer and use it in GitHub Desktop.
Simple Timer
This file contains hidden or 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
from tkinter import * | |
import tkinter.font as font | |
import threading | |
window=Tk() | |
window.title("Remind Chris to get up.") | |
helv36 = font.Font(family='Helvetica', size=36, weight=font.BOLD) | |
def beep(): | |
for i in range(1,5): | |
print("\a") | |
def start_timer(): | |
button.config(bg="yellow") | |
t = threading.Timer(1800.0, stop_timer) | |
t.start() | |
def stop_timer(): | |
button.config(bg="red") | |
beep() | |
button=Button(window,text="Start",height=5, width=10,font=helv36,command=start_timer, bg="green") | |
button.grid(row=0,column=0) | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment