Hello.
I have a Class in my python file. That Class contains some functions.
How can i set the command of a Tkinter butten so that call a function of that class?
I tried this but it didn't work:
class calculating(object):
def __inint__(self):
self.current = 0
def addition(self, amount):
self.current += amount
def result(self):
return self.current
print (self.current)
def show(self):
lbl["text"] = result()
btn1 = Button(root, text = "add", command = calculating.addition)
btn1.pack()
btn2 = Button(root, text = "result", command = calculating.show)
btn2.pack()
lbl = Label(root)
lbl.pack