Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter clock
#1
Hello everyone,

I need help to make simple clock app which will change background color in choosen periods with duration for few secc and after then transform back. I created simple clock with tkinter, which you can see bellow, but I have problem with conditions of the changing of background color. I will appreciate any idea. thanks

import sys
from tkinter import *
import time

def tick():
    time_string=time.strftime("%H:%M:%S")
    clock.config(text=time_string)
    clock.after(200,tick)
    
root=Tk()
clock=Label(root, font=("times", 100, "bold"), bg="red")
clock.grid(row=0, column=1)
tick()
root.mainloop()
Reply


Messages In This Thread
tkinter clock - by Ondrej - Jun-06-2019, 12:14 PM
RE: tkinter clock - by heiner55 - Jun-06-2019, 01:17 PM
RE: tkinter clock - by Ondrej - Jun-06-2019, 01:28 PM
RE: tkinter clock - by heiner55 - Jun-06-2019, 01:34 PM
RE: tkinter clock - by Ondrej - Jun-06-2019, 01:37 PM
RE: tkinter clock - by heiner55 - Jun-06-2019, 02:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python clock menator01 2 2,104 May-14-2020, 10:23 PM
Last Post: menator01
  [Tkinter] Alarm Clock GUI tickandatock_ 1 4,122 Nov-10-2019, 02:52 AM
Last Post: Larz60+
  Clock freezes - wx.python glib problem strongheart 3 4,055 Oct-10-2017, 03:36 AM
Last Post: strongheart

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020