Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7198

Tkinter code for a Timer is crashing the app (python)

$
0
0

I am creating a timer for my quiz app and I decided to try it out first in a separate program,however when I run the following code and press the 'start timer' button the app simply stops respondingand I am forced to close it through the task manager

from tkinter import *import timeroot=Tk()root.geometry('{}x{}'.format(300,200))lb=Label(root,text='')lb.pack()def func(h,m,s):    lb.config(text=str(h)+':'+str(m)+':'+str(s))    time.sleep(1)    s+=1    func(h,m,s)    if s==59:        m=1        s=0bt=Button(root,text='start timer',command=lambda:func(0,0,0))bt.pack()root.mainloop()

Viewing all articles
Browse latest Browse all 7198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>