svp j'ai une liste des chemins je veux qu'elle sera affichée à l'utilisateur il choisit et puis je lancerai un traitement sur ces chemins là. j'ai réussi à faire ça mais j'arrive pas à afficher la liste des choix selectionés. merci d'avance


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root = tk.Tk()
 
def traitement():
    print ("les choix sont:", a.get(a.cureselection()))
 
label = Label(root, text="liste des choix", font =('arial', 18, 'bold'), fg="blue")
label.pack
 
a = tk.Listbox( root, width=100, height=20, selectmode = "multiple", font =('arial', 12), fg="black" )
for j in list_chemin:
    a.insert( ACTIVE, str(j))
    a.pack()
 
# Création d'un widget Button (bouton Lancer)
Bouton1 = Button(root, text = 'Lancer', font =('arial', 14, 'bold'), fg="green", command=traitement)
Bouton1.pack()
# Création d'un widget Button (bouton Quitter)
Bouton2 = Button(root, text = 'Quitter', font =('arial', 14, 'bold'), fg="red")
Bouton2.pack()
 
root.mainloop()