Displayotron Santa countdown


#1

Im not very good with python so might be way off the mark here. But what I am trying to do is make a Santa countdown showing how far away Santa is in Miles. Based in the uk I want it to start christmas eve at 11am in morning when santa hits New Zealand (which is 11659 miles away) and 13 hours ahead of us. counting down the miles at a rate of one mile every four seconds and the display showing "Santa is X miles away) and once its counted down to display “Go check under the tree Santa has been!!!”

If someone wants to continue the project feel free, my skills are limited but im sure this would be a great idea for all those excited kids on christmas eve. :)

''' tk_countdown.py
countdown to santa using Tkinter
use update() after sleep()
'''
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
import time 
from dot3k import lcd
def countDown():
'''start countdown'''
lbl.config()
for k in range(11659, -1, -1):
    lbl["text"] = k 
    lcd.write["text"] = k ("miles away")
    time.sleep(4.6)
    root.update()  # Tk needs this after sleep()
lbl.config()
lbl["text"] = "Quick Santa Has Been!!"
lcd.write("Santa Has Been!!!")
root = tk.Tk()
label_font = ('Times', 50)
lbl = tk.Label(font=label_font)
lbl.pack(fill='both', expand=1)
countDown()
root.mainloop()