我试图用一个单选按钮制作一个基本的绘图程序来确定画笔的形状。在
self.choseo = Radiobutton(text='Circle', variable=shape,indicatoron=0, value=1)
self.choser = Radiobutton(text='Rectangle', variable=shape,indicatoron=0, value=2)
self.chosea = Radiobutton(text='Arc', variable=shape,indicatoron=0, value=3)
对应于:
^{pr2}$当我运行这个时,我得到了这个错误:
"TypeError: get() takes exactly 1 argument (0 given)"
我该怎么做?在
您没有告诉您
shape
是什么,但是您应该确保使用IntVar
的实例。在请尝试以下代码:
并且
shape.get()
将以您想要的方式工作。在相关问题 更多 >
编程相关推荐