Python Forum
[Tkinter] how to get the entry information using Entry.get() ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] how to get the entry information using Entry.get() ?
#3
You have to keep a reference to each individual Entry, in this case x. Each pass through the for overlays the previous x, so it no longer exists. So, using a dictionary below, so you can store everything in one container

## NOT tested - don't have time
## post back if there are problems

        self.entry_dict={}
        for x in self.listeF:
 
            ##global  entree
 
            ## don't have to keep a reference to the Label
            ## since it isn't accessed anywhere else
            Label(self.fenetre, text=x, bg='#cecece',
                  fg='black').grid(row=1, column=2,
                  rowspan =  R_span, pady = R_pady, sticky = W)
            y = Entry(self.fenetre, bg='black', fg='white')
            y.grid(row=1, column=3, rowspan=R_span, pady=R_pady, sticky = NW)
            self.entry_dict[x]=y
        print("entry_dict", self.entry_dict) ## self.listeF item --> tkinter instance

    def Entree_Get(self):
        for x in self.listeF:  ## read the dict in this order
            print(x, self.entry_dict[x].get()) 
Reply


Messages In This Thread
RE: how to get the entry information using Entry.get() ? - by woooee - Mar-18-2019, 05:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ValueError: could not convert string to float: '' fron Entry Widget russellm44 5 683 Mar-06-2024, 08:42 PM
Last Post: russellm44
  [Tkinter] entry widget DPaul 5 1,531 Jul-28-2023, 02:31 PM
Last Post: deanhystad
  [PyGUI] Invalid command error with Entry object eliqm 8 2,189 May-18-2023, 10:14 PM
Last Post: eliqm
  Get string from entry and use it in another script amdi40 1 1,400 Jan-26-2022, 07:33 PM
Last Post: Larz60+
  [Tkinter] Making entry global in tkinter with multiprocessing luckyingermany 2 2,336 Jan-21-2022, 03:46 PM
Last Post: deanhystad
  [Tkinter] How Does Entry Verification Work? gw1500se 2 1,628 Nov-17-2021, 02:16 PM
Last Post: gw1500se
  [Tkinter] define entry via class on a loop drSlump 9 3,452 Oct-27-2021, 05:01 PM
Last Post: deanhystad
  Tkinter Exit Code based on Entry Widget Nu2Python 6 3,000 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [Tkinter] Update variable using tkinter entry methon drSlump 6 5,214 Oct-15-2021, 08:01 AM
Last Post: drSlump
  Tkinter | entry output. Sap2ch 1 2,004 Sep-25-2021, 12:38 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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