Guys, I need help with the implementation of the countdown timer, implemented exactly on python + tkinter. Functionality: 1 start button - start counting; 2- restart-button to reset the timer to its original position (2 min. 00 s); 3 (or 3 and 4) - data output on the screen. Starting position -2 minutes. Today, for the first time I ran into Tkinter and was already dizzy. That's what sketched
from tkinter import * import time class Application(Frame): def __init__(self, master= None): Frame.__init__(self,master) self.pack() self.createWidgets() def createWidgets(self): self.minutes = IntVar() self.l_min = Label(self,font=('Helvetica',24)) self.l_min.pack(side='top') self.l_min['textvariable'] = self.minutes self.seconds = IntVar() self.l_sec = Label(self, font=('Helvetica', 24)) self.l_sec.pack(side='top') self.l_sec['textvariable'] = self.seconds self.b_start = Button(self, text ='START',fg='red') self.b_start.bind('<Button-1>', self.start_timer) self.b_start.pack(side= 'bottom') self.b_restart = Button(self, text ="RESTART", fg='blue') # self.b_restart.bind('<Button-1>',reset_timer) self.b_restart.pack(side= 'bottom') def start_timer(self,mins): for mins in range(1,-1,-1): self.minutes.set(mins) for secs in range(59,-1,-1): self.seconds.set(secs) time.sleep(1) def reset_timer(self): pass root= Tk() app = Application(master=root) root.mainloop() I would be grateful for the help or hint. ZY Similar topics are many, but only under javascript or other PL.