title: How to get the selected item in a Python TkInter multiple combobox in a loop?
body: <p>I would like to create a table similar to Excel's style. It should be depending on the size of the array to show.
  For this reason the table columns and rows are inside loop cycles.
  In the first line I would have a combobox to select the value to filter.
  Also the combobox is inside a loop cycle for the different columns number.</p>
  <p>When the table is created I am not able to recognize which combobox is chosen.</p>
  <p>How can I do?</p>
  <p><img src="https://i.stack.imgur.com/oypM6.png" alt="screenshot" /></p>
  <p>Example:</p>
  <pre class="lang-py prettyprint-override"><code>import tkinter
  from tkinter import ttk #per button, label etc
  from tkinter.ttk import *
  import numpy as np #for the matrix tools
  
  def newselection(event, output):
      print(&quot;Value selected:&quot;, event, output)
  
  def ShowTableGui(MatrixToShowIn):
      MatrixToShow=np.array(MatrixToShowIn)
      RowNumber = MatrixToShow.shape[0]
      ArrayCombo=[]
      windowx=tkinter.Tk()
      windowx.title(&quot;Table viewer&quot;)
      buttonExit = ttk.Button(windowx, text=&quot;Close table&quot;, command=windowx.destroy)
  #    buttonExit = ttk.Button(windowx, text=&quot;Run Filter&quot;, command= lambda: Run_filter(MatrixToShow.shape[1]))
      buttonExit.grid(column=0, row=0)
      for Col in range (int(MatrixToShow.shape[1])):
          ValuesInsert=MatrixToShow[:,Col] # values in column
          ValuesInsert=[row[Col]for row in MatrixToShowIn]
          ValuesInsert=list(set(ValuesInsert)) # values listed only once
          ValuesInsert.sort()
          ValuesInsert.insert(0,&quot;*&quot;) # add * to filter all
          comboExample0 = ttk.Combobox(windowx, state='readonly', values=ValuesInsert)
          comboExample0.grid(column=Col+2, row=0)
          comboExample0.bind(&quot;&lt;&lt;ComboboxSelected&gt;&gt;&quot;, lambda event:newselection(comboExample0.get(), &quot;output&quot;))
  #        comboExample0.bind(&quot;&lt;&lt;ComboboxSelected&gt;&gt;&quot;, lambda event:newselection(event, &quot;output&quot;))
          ArrayCombo.append(comboExample0)
          Select=comboExample0.get()
          print(Select)
          for Row in range (RowNumber):
              b = Entry(windowx, text=&quot;&quot;)
              b.grid(row=Row+1, column=Col+2)
              b.insert(0,str(MatrixToShow[Row][Col]))
      windowx.mainloop()
      return()
      
  MatrixToShowIn=[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
  ShowTableGui(MatrixToShowIn)
  </code></pre>