1from tkinter import Label, Button
2blink = 0
3
4class MyClass(tk.Frame):
5 def __init__(self, master):
6 self.master = master
7 super().__init__(self.master)
8
9 global blink
10
11 self.label = Label(master, text=blink)
12 self.button = Button(master, text="Button", command=lambda: foo(self.label))
13 self.label.pack()
14 self.button.pack()
15 #self.blinkCheck()
16
17 def blinkCheck(self):
18 global blink
19 while True:
20 print("blink in blinkCheck method is = {}".format(blink))
21 time.sleep(2.5)
22
23 def foo(self, label):
24 label.config(text=blink)