So maybe this is a pretty basic question, then again I am new to python so please bear with me...
I have some code, and I have a tkInter checkbox. I figured out how to get the on/off value of the check box but I dont really understand why I need to do it the way I do.
def __init__(self, master):
self.var = IntVar()
c = Checkbutton(master, text="TEST_BUTTON",
variable=self.var, command=self.testFunc)
c.pack()
def testFunc(self, event):
print self.var.get()
My question is; self.var.get() gets me the 0/1 value of var which is what I want so I can eventually use the value as a flag to preform some function. It took me a while to figure this out though.
Why doesnt print self.var give me the 0/1 value of the check box?