如何在python中获取checkbutton的状态?我有这个:
def doSomething():
if #code goes here, if checkbutton is selected
...
check = Checkbutton(window, text="Add both", onvalue = 1, offvalue = 0)
check.pack(side="right")
Run Code Online (Sandbox Code Playgroud) 我有一个全局实例,__del__
当Python解释器退出时,我希望它被销毁(函数调用).我是否期望过多的Python解释器?我测试它的方法是在__del__
函数中放置一个打印,从命令行运行python.exe
,然后按Ctrl/Break.此时,我希望在命令行窗口中看到打印.但是,我没有.