Bonjour, je voudrais savoir comment on fait pour récuperer tous les éléments d'une listbox sous python 3.4 avec tkinter.
Voici mon code:
J'aimerais que la fonction getall m'affiche donc 1,2,3,4.
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 from tkinter import * master = Tk() def getall(): print ("click!") listbox = Listbox(master) listbox.pack() for item in ["1", "2", "3", "4"]: listbox.insert(END, item) b = Button(master, text="get all", command=getall) b.pack() mainloop()
Merci d'avance pour votre aide.
Partager