Python Forum
Problem with Submit button Tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Submit button Tkinter
from tkinter import *

window = Tk()
window.title("Application de retraite")
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)
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)
you must use .get()

Messages In This Thread
Problem with Submit button Tkinter - by Reldaing - Jan-04-2020, 09:39 AM
RE: Problem with Submit button Tkinter - by balenaucigasa - Jan-05-2020, 01:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter showing image in button rwahdan 3 144 Jun-16-2021, 06:08 AM
Last Post: Yoriz
  tkinter button image Nick_tkinter 4 570 Mar-04-2021, 11:33 PM
Last Post: deanhystad
  Python3 tkinter radiobutton problem Nick_tkinter 14 845 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  tkinter python button position problem Nick_tkinter 3 704 Jan-31-2021, 05:15 AM
Last Post: deanhystad
  TKinter restarting the mainloop when button pressed zazas321 7 1,488 Jan-26-2021, 06:38 AM
Last Post: zazas321
  tkinter touchscreen scrolling - button press makes unwanted scrolling nanok66 1 580 Dec-28-2020, 10:00 PM
Last Post: nanok66
  [Tkinter] Button click problem using OOP JohnB 5 672 Oct-21-2020, 12:43 PM
Last Post: JohnB
  Tkinter - How can I remove the background borders from ttk.Button? TurboC 4 3,651 Oct-18-2020, 10:58 AM
Last Post: TurboC
  [Tkinter] ClockIn/Out tkinter problem Maryan 2 538 Oct-12-2020, 03:42 AM
Last Post: joe_momma
  tkinter | Button color text on Click Maryan 2 730 Oct-09-2020, 08:56 PM
Last Post: Maryan

Forum Jump:

User Panel Messages

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