I have a Checkbutton object associated with it and IntVar, but when I try to get the value var, I get PY_VAR0.
Here is my code:
from tkinter import *
root = Tk()
def show_state():
print(var)
var = IntVar()
cbtn = Checkbutton(root, text='Check', variable=var, command=show_state)
cbtn.pack()
root.mainloop()
Why am I getting PY_VAR0?
source
share