Mar-27-2022, 03:58 AM
Using this example, is there a way to return the updated value or how to use the after method in the main?
import tkinter as tk class Window(tk.Tk): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.count = 0 self.label = tk.Label(self, text='Hello World') self.label.pack() def counter(self): self.count += 1 # self.after(1000, self.counter) self.label['text'] = self.count return self.count if __name__ == '__main__': app = Window() app.after(1000, app.counter) app.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts