如何设置复选按钮";“真的”;用python

如何设置复选按钮";“真的”;用python,python,checkbox,tkinter,Python,Checkbox,Tkinter,如何在启动时将checkbutton设置为true,当前在运行程序时它显示为空复选框。我想让checkbutton开始选中而不是取消选中 这是我的checkbutton代码 self.checkbutton = Checkbutton(self.frame1, text="Automatisch", onvalue=1, pady=12, padx=0, command=self.set_automatic_bool).grid(row=1, column=1, columnspan=5, s

如何在启动时将checkbutton设置为true,当前在运行程序时它显示为空复选框。我想让checkbutton开始选中而不是取消选中

这是我的checkbutton代码

self.checkbutton = Checkbutton(self.frame1, text="Automatisch", onvalue=1, pady=12, padx=0, command=self.set_automatic_bool).grid(row=1, column=1, columnspan=5,  sticky=NSEW)

只需简单的
self.checkbutton.select()
只需简单的
self.checkbutton.select()
没有问题也有
。如果需要,取消选择()
。如果需要,取消选择()