我试图返回是否标记了一个复选按钮,但是它不起作用。即使标记为应打印1,它也始终打印0。
var7_u = IntVar()
self.var7_u=var7_u
var7_s = IntVar()
self.var7_s=var7_s
year7_label = Label(root,text="Y7").grid(row=5)
self.year7_upper_check = Checkbutton(root,variable=var7_u)
self.year7_upper_check.grid(row=5,column=1)
year7_standard_check = Checkbutton(root,variable=var7_s).grid(row=5,column=3)
submit_but = Button(root,text="Submit",command=lambda[self.insert(self.var7_s,self.var7_u)])
def insert(self,var7_u,var7_s):
variable=var7_u.get()
print(variable)