python tkinter get value of checkbox
from tkinter import *
root = Tk()
value = IntVar()
example = Checkbutton(root, variable=value)
example.pack()
# 1 = clicked
# 0 = not clicked
print(value.get())
root.mainloop()
0
1
example = Checkbutton(root)
example.grid(row=0, column=0)
example.select()
Thank you!
1
0
Are there any code examples left?
New code examples in category Python