Check box with python

 from tkinter import *


def display():
    if(x.get()==1):
        print("You agreed")
    else:
        print("you not agreed")




# x = IntVar(

window = Tk()
= IntVar()
check_btn = Checkbutton(window, 
                        text="I am agree with this",
                        variable=x,
                        onvalue=1,
                        offvalue=0,
                        command=display)
check_btn.pack()
window.mainloop()

Comments