Hi. I am not exactly new to python but I have never done anything related to time and I don't know how. I want to make a count down timer that starts when I start a program and then either closes when I close the program or when it counts down to zero. Please help.
countdown to New Year using Tkinter
use update() after sleep()
import Tkinter as tk
import tkinter as tk
'''start countdown 10 seconds before new year starts'''
for k in range(10, -1, -1):
lbl["text"] = k
root.update() # Tk needs this after sleep()
lbl["text"] = "Happy new year!"
root = tk.Tk()
label_font = ('helvetica', 40)
lbl = tk.Label(font=label_font)