37,743
社区成员




from tkinter import *
root = Tk()
def p():
print('checkbutton')
#如何打印调用此函数的checkbutton的text?
chk = Checkbutton(root, text = 'checkbutton', variable = 1, onvalue = 1, command = p)
chk.pack()
print(chk.variable)
print(chk.onvalue)
root.mainloop()