Skip to content Skip to sidebar Skip to footer

Python Tkinter After Event Oops Implementation

I am very new to Python and even to oops, I want to convert this stackoverflow solution to oops, but it is not working. I am not able to figure out where should I put after, tick a

Solution 1:

Instead of passing your tick- and rest-functions to the after- and bind-functions, you actually call them (with ()), so you run into a stackoverflow.


self.after(1000, self.tick())

should be

self.after(1000, self.tick)

both in initialize and in tick; and also

self.bind('<KEY>',self.reset())
self.bind('<Button-1>',self.reset())

should be

self.bind('<Key>',self.reset) # note also your type here: it's Key not KEYself.bind('<Button-1>',self.reset)

Post a Comment for "Python Tkinter After Event Oops Implementation"