0

これが私の関数です。値の異なる 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])

ありがとう。

4

1 に答える 1