#!/usr/bin/python

from tkinter import *
from tkinter import ttk
from tkinter import font
import time
import datetime

global endTime 

def quit(*args):
    root.destroy()
    
def show_time():
    # Get the time remaining until the event
    remainder = endTime - datetime.datetime.now()
    # remove the microseconds part
    remainder = remainder - datetime.timedelta(microseconds=remainder.microseconds)
    # Show the time left
    txt.set(remainder)
    # Trigger the countdown after 1000ms
    root.after(1000, show_time)

# Use tkinter lib for showing the clock
root = Tk()
root.attributes("-fullscreen", True)
root.configure(background='black')
root.bind("c", quit)  #How To Exit Countdown (Control c)
root.after(1000, show_time)

# Set the end date and time for the countdown
endTime = datetime.datetime(2022, 6, 22, 7, 0, 0) #Year,Month,Day,Hour,Minute,Second

fnt = font.Font(family='Helvetica', size=60, weight='bold') #Change Text Size 
txt = StringVar()
lbl = ttk.Label(root, textvariable=txt, font=fnt, foreground="red", background="black") #Change Text Color And Background Color
lbl.place(relx=0.5, rely=0.5, anchor=CENTER)

root.mainloop()