from tkinter import *
root = Tk()
fN = StringVar()
sN = StringVar()
age = StringVar()
yG = StringVar()
Label(root, text="First Name").grid(row=0, sticky=W, padx=4)
fName = Entry(root, width=50, textvariable=fN).grid(row=0, column=1, sticky=E, pady=4)
Label(root, text="Surname").grid(row=1, sticky=W, padx=4)
sName = Entry(root, width=50, textvariable=sN).grid(row=1, column=1, sticky=E, pady=4)
Label(root, text="Age").grid(row=2, sticky=W, padx=4)
age = Entry(root, width=50, textvariable=age).grid(row=2, column=1, sticky=E, pady=4)
Label(root, text="Year Group").grid(row=3, sticky=W, padx=4)
yearGruop = Entry(root, width=50, textvariable=yG).grid(row=3, column=1, sticky=E, pady=4)
fName_1 = fN.get()
retourner la valeur du LaChaine ' fN » et stockerim en utilisant .get() pour retourner la valeur de la zone de saisie du nom « fName » puis l'imprimer sur le clic du bouton ... mais sa ne fonctionne pas
def print_():
print (fName_1)
pas l'impression du contenu de la première zone de saisie de nom ##
Button(root, text="Create account", command=print_).grid(row=4, column=1)
root.mainloop()