Impossible de récupérer la valeur de mes radiobutton, arrachage de cheveux
Bonjour à tous et à toutes,
Ma question sera nécessairement stupide et loin d'être difficile à résoudre mais c'est en dernier recours que je viens la poser ici, j'ai cherché des heures durant mais sans succès.
Je débute dans la programmation G.u.i, merci de ceux qui voudront bien m'apporter leurs lumières :)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
def install_go():
print boxe_prise.get()
def install():
install = Tk()
cochez = Label(install, text ="Cochez la Rogue voulue ?")
boxe_prise = StringVar()
global boxe_prise
radiobutton1 = Radiobutton(install, text="Choix 1", variable=boxe_prise, value="Freebox", command=install_go)
radiobutton2 = Radiobutton(install, text="Choix 2", variable=boxe_prise, value="Numericable", command=install_go)
radiobutton3 = Radiobutton(install, text="Choix 3", variable=boxe_prise, value="Livebox", command=install_go)
radiobutton4 = Radiobutton(install, text="Choix 4", variable=boxe_prise, value="Bbox", command=install_go)
button_install = Button(install, text ="APPLIQUER", command=install.destroy)
button_install.grid(row = 6, column = 1)
radiobutton1.grid(row = 1, column = 0)
radiobutton2.grid(row = 1, column = 1)
radiobutton3.grid(row = 2, column = 0)
radiobutton4.grid(row = 2, column = 1)
cochez.grid(row = 0, column = 0)
install.mainloop() |
Quand je sélectionne un champ, le print ne renvoie rien ...
Merci d'avance :)
Carto_