title: How to add multiple ttk.Entry values to a list or dictionary and use get method to retrieve values
body: <p>I have a for loop that creates multiple rows and columns of labels and entries from a Treeview selection and sets the entries to current Treeview values.</p>
  <pre class="lang-py prettyprint-override"><code>import tkinter as tk
  from tkinter import ttk
  allitems = {}
  keys = ['UID', 'Col5', ...]
  entries = []
  
  selections = trv.selection()
  
  uid = &quot;,&quot;.join([str(trv.item(i)['values'][0]) 
                  for i in selections])
  col5 = &quot;,&quot;.join([str(trv.item(i)['values'][5]) 
                  for i in selections])
  
  for i in range(0, len(selections)):
     l1 = ttk.Label(top, text=&quot;UID:&quot;)
     l1.grid(row=i, column=0, sticky=tk.W)
     uidentry = ttk.Entry(top)
     uidentry.grid(row=i, column=1)
     uidentry.insert(0, uid.split(&quot;,&quot;)[i])
     l2 = ttk.Label(top, text=&quot;Col5:&quot;)
     l2.grid(row=i, column=2, sticky=tk.W)
     col5entry = ttk.Entry(top)
     col5entry.grid(row=i, column=3)
     col5entry.insert(0, col5.split(&quot;,&quot;)[i])
     ... 
     ...
  get_butt = tk.Button(top, text=&quot;Get All&quot;)
  get_butt.grid(column=6)
  </code></pre>
  <p>There are 7 labels and 7 entry widgets created in this loop. I'm trying to get the values of the entries stored in a dictionary or list temporarily for me to use the get method to create an update function for a button. I've tried some examples I've seen from other posts like</p>
  <pre class="lang-py prettyprint-override"><code>entries.append(uidentry)
  entries.append(col5entry)
  </code></pre>
  <p>and doing</p>
  <pre class="lang-py prettyprint-override"><code>for i, j in zip(keys, entries):
     allitems.update({i: j})
  </code></pre>
  <p>and adding a function for a button like this</p>
  <pre class="lang-py prettyprint-override"><code>def get_all():
     for keys, v in allitems.items():
        items = keys, v.get()
        print(items)
  </code></pre>
  <p>but it only prints the first set of Keys and entry values.</p>
  <p>What I'm wanting to achieve is to have all the uidentry values attach to ['UID'] in order and col5entry values attach to ['Col5'] maybe something kinda like this</p>
  <pre class="lang-py prettyprint-override"><code>{'UID':['E001', 'E002', 'E003', .....]
  'Col5':['Stuff1', 'Stuff2', 'Stuff3', .....]}
  </code></pre>
  <p>I'm new to python and really struggling with the logic of how to achieve this properly. Here is a Pastebin of my working code with Treeview set up so you can copy test/ see what I'm working with.
  <a href="https://pastebin.com/n0DLQ5pY" rel="nofollow noreferrer">https://pastebin.com/n0DLQ5pY</a><br />
  <strong>EDIT: If you test the snippet of the app the event to trigger show_popup is hitting the ENTER key after making selections on Treeview.</strong></p>