1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| #!usr/bin/python
# -*- coding: utf-8 -*-
import tkinter as Tk
root = Tk.Tk()
root.title('titre')
texte = Tk.Label(root, text = 'Famille')
texte.grid(row=0, column=0)
question = Tk.Entry(root)
question.insert(Tk.INSERT,'Graminee1') #pour avoir une proposition dès l'affichage d'Entry
question.grid(row=0, column=1)
def fnc(): #fnc devrait afficher une proposition la modifie et la restitue
global reponse
proposition = 'Graminee2'
question = Tk.Entry(root)
question.insert(Tk.INSERT,proposition)
question.grid(row=0, column=1)
reponse = question.get() #Pas moyen de modifier la reponse ???
print(question , reponse)
return()
reponse = 'Graminee2'
btn = Tk.Button(root, text = 'Ajouter', command = fnc)
btn.grid(row = 0, column = 2)
root.mainloop() |
Partager