b1 = Button(win,padx = 70,pady = 70,bg = "gray", command = lambda: click(b1))
b2 = Button(win,padx = 70,pady = 70, command = lambda: click(b2))
b3 = Button(win,padx = 70,pady = 70, command = lambda: click(b3))
b4 = Button(win,padx = 70,pady = 70, command = lambda: click(b4))
b5 = Button(win,padx = 70,pady = 70, command = lambda: click(b5))
b6 = Button(win,padx = 70,pady = 70, command = lambda: click(b6))
b7 = Button(win,padx = 70,pady = 70, command = lambda: click(b7))
b8 = Button(win,padx = 70,pady = 70, command = lambda: click(b8))
b9 = Button(win,padx = 70,pady = 70, command = lambda: click(b9))
for n in range(10):
bn.configure(text=="something") #To modify all buttons with loop
如何使用for循环动态修改按钮的名称?
湖上湖
沧海一幻觉
相关分类