##### Problem with Submit button Tkinter
 Problem with Submit button Tkinter Reldaing Silly Frenchman Posts: 22 Threads: 12 Joined: Nov 2019 Reputation: Jan-04-2020, 09:39 AM (This post was last modified: Jan-04-2020, 09:39 AM by Reldaing.) HI, If you take a look on my precedent code , I managed to do it. The issue is when I press the button "make_it", it prints me 0, so I think that nothing happened and the values that I registered weren't taken. Btw, the function "calcul_fonctionnaire" is just a function in which I take all the values and make some calculation and gives me a list of 2 int in it ```def retraite_fonctionnaire(): i=input("Entrez votre nom: ") k=input("Quelle est votre année de naissance ?: ") revenu_moyen=int(input("Quel est votre salaire mensuel sur ces 6 derniers mois?: ")) trimestre_cotisés = int(input("Combien de trimestres avez vous cotisé ?: " )) enfants = int(input("Combien avez vous d'enfants ?: " )) L = calcul_fonctionnaire(i,k,revenu_moyen,trimestre_cotisés,enfants) return L window= Tk() window.title("Application de retraite") window.geometry("640x640") label1= Label(window,text="Entrez votre nom: ",font=("arial",15,"bold"), fg="black").place(x=20, y=200) i= StringVar() entry_box1= Entry(window, textvariable="i", bg="gray", width="15").place(x=300,y=200) label2= Label(window,text="Quelle est votre année de naissance?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=300) k= int() entry_box2= Entry(window, textvariable="k", bg="gray", width="15").place(x=300,y=300) label3= Label(window,text="Quel est votre revenu mensuel sur vos vingt-cinq meilleures années ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=400) revenu_moyen= int() entry_box3= Entry(window, textvariable="revenu_moyen", bg="gray", width="15").place(x=300,y=400) label4= Label(window,text="Combien de trimestres avez vous cotisé ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=500) trimestre_cotisés= int() entry_box4= Entry(window, textvariable="trimestre_cotisés", bg="gray", width="15").place(x=300,y=500) label5= Label(window,text="Combien avez vous d'enfants ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=600) enfants=int() entry_box5 = Entry(window, textvariable="enfants", bg="gray", width="15").place(x=300,y=600) calcul_salarie(i,k,revenu_moyen,trimestre_cotisés,enfants) def do_it(): calcul_salarie(i,k,revenu_moyen,trimestre_cotisés,enfants) print(calcul_salarie(i,k,revenu_moyen,trimestre_cotisés,enfants)) make_it= Button(window, text="PRINT", width="30", height="20",command=do_it,bg="lightblue").place(x=500, y=500) window.mainloop()``` Reply balenaucigasa Programmer named Tim Posts: 8 Threads: 1 Joined: Oct 2019 Reputation: Jan-05-2020, 12:54 AM replace all "int()" with "IntVar()" e.g. k= IntVar() remove all "" from textvariable="i", ="k", ="revenu_moyen" ... correct is textvariable=i Reply balenaucigasa Programmer named Tim Posts: 8 Threads: 1 Joined: Oct 2019 Reputation: Jan-05-2020, 01:58 AM ```from tkinter import * window = Tk() window.title("Application de retraite") window.geometry("640x640") label1 = Label(window,text="Entrez votre nom: ",font=("arial",15,"bold"), fg="black").place(x=20, y=200) i= StringVar() entry_box1= Entry(window, textvariable=i, bg="gray", width="15").place(x=300,y=200) label2= Label(window,text="Quelle est votre année de naissance?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=300) k= IntVar() entry_box2= Entry(window, textvariable=k, bg="gray", width="15").place(x=300,y=300) label3= Label(window,text="Quel est votre revenu mensuel sur vos vingt-cinq meilleures années ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=400) revenu_moyen= IntVar() entry_box3= Entry(window, textvariable=revenu_moyen, bg="gray", width="15").place(x=300,y=400) label4= Label(window,text="Combien de trimestres avez vous cotisé ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=500) trimestre_cotisés= IntVar() entry_box4= Entry(window, textvariable=trimestre_cotisés, bg="gray", width="15").place(x=300,y=500) label5= Label(window,text="Combien avez vous d'enfants ?: ",font=("arial",15,"bold"), fg="black").place(x=20, y=600) enfants=IntVar() entry_box5 = Entry(window, textvariable=enfants, bg="gray", width="15").place(x=300,y=600) def do_it(): print(i.get(), k.get(), revenu_moyen.get(), trimestre_cotisés.get(), enfants.get()) make_it = Button(window, text="PRINT", width="18", height="9",command=do_it,bg="lightblue").place(x=500, y=470) window.mainloop()```you must use .get() Reply

 Possibly Related Threads… Thread Author Replies Views Last Post Can't get tkinter button to change color based on changes in data dford 4 1,542 Feb-13-2022, 01:57 PM Last Post: dford Creating a function interrupt button tkinter AnotherSam 2 2,243 Oct-07-2021, 02:56 PM Last Post: AnotherSam [Tkinter] Have tkinter button toggle on and off a continuously running function AnotherSam 5 1,728 Oct-01-2021, 05:00 PM Last Post: Yoriz problem with radio button crook79 3 1,592 Aug-12-2021, 02:30 PM Last Post: deanhystad tkinter showing image in button rwahdan 3 3,042 Jun-16-2021, 06:08 AM Last Post: Yoriz tkinter button image Nick_tkinter 4 2,408 Mar-04-2021, 11:33 PM Last Post: deanhystad Python3 tkinter radiobutton problem Nick_tkinter 14 3,158 Feb-15-2021, 11:01 PM Last Post: Nick_tkinter tkinter python button position problem Nick_tkinter 3 1,972 Jan-31-2021, 05:15 AM Last Post: deanhystad TKinter restarting the mainloop when button pressed zazas321 7 8,963 Jan-26-2021, 06:38 AM Last Post: zazas321 tkinter touchscreen scrolling - button press makes unwanted scrolling nanok66 1 2,391 Dec-28-2020, 10:00 PM Last Post: nanok66

Forum Jump:

### User Panel Messages

##### Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020