且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何更改python(3)中列表内所有对象的属性?

更新时间:2023-11-29 08:38:58

只需循环遍历您的列表:

Simply loop over your list:

for button in btnList:
    button.configure(state='disabled')

button 将从您的列表中依次分配每个按钮,让您在其上调用 configure() 方法.

button will be assigned each button from your list in turn letting you call the configure() method on it.