这是我的函数,它生成 4 个具有不同值的按钮,但我想要的是销毁之前创建的按钮。
def bouttonedSeg():
segments = randSeg()
b1 = Button(fenetre, text=segments[0], command=lambda:ecrire_segment(segments[0]))
b1.place(x=100,y=100)
b2 = Button(fenetre, text=segments[1], command=lambda:ecrire_segment(segments[1]))
b2.place(x=100,y=120)
b3 = Button(fenetre, text=segments[2], command=lambda:ecrire_segment(segments[2]))
b3.place(x=100,y=140)
b4 = Button(fenetre, text=segments[3], command=lambda:ecrire_segment(segments[3]))
b4.place(x=100,y=160)
pc.copy(segments[0] + ";" + segments[1] + ";" + segments[2] + ";" + segments[3])
谢谢。