from Tkinter import * states = [] def onPress(i): states[i] = not states[i] root = Tk( ) root.title("Bouton des options") for i in range(10): chk = Checkbutton(root, text=str(i), command=(lambda i=i: onPress(i)) ) chk.pack(side=LEFT) states.append(0) root.mainloop( ) |
Livres Sur ce Sujet
Apprendre à programmer avec Python 3 Apprenez à programmer en Python Python : Petit guide à l’usage du développeur agile Apprendre à programmer avec Python 3 : Avec plus de 50 pages de corigés d’exercices !