Jun-06-2019, 01:17 PM
import sys, random from tkinter import * import time . colors = ( "red", "black", "blue" ) def tick(): time_string=time.strftime("%H:%M:%S") clock.config(text=time_string) clock.after(1000,tick) clock["bg"] = colors[random.randint(0, len(colors)-1)] root=Tk() clock=Label(root, font=("times", 100, "bold"), bg="red") clock.grid(row=0, column=1) tick() root.mainloop()