title: How to get value from tkinter Combobox binded func
body: <p>I'm a rookie in Python. I want to get a dynamic value from ComboboxSelected to self.wwc, but it doesn't work. Could you give some advises or suggestions to me? Thanks.</p>
  <pre><code>class Application(tk.Frame):
      
       def __init__(self, master):
           tk.Frame.__init__(self,master)
           self.grid()
           self.createWidgets()
       
       def createWidgets(self):
  
          # Company Options
          df3 = pd.read_sql(wwc_query, conn)
          wwc_set = df3.loc[:,'Company']
          self.comboboxText = tk.StringVar()
          self.wwc_list = wwc_set.to_string(index=False)
          self.companyOpt = ttk.Combobox(self.wrapper1, textvariable=self.comboboxText, state='readonly')
          self.companyOpt['values']=self.wwc_list
          self.companyOpt.set('-Select-')
          self.companyOpt.grid(row=0, column=0, sticky=tk.W+tk.N)
          self.companyOpt.bind('&lt;&lt;ComboboxSelected&gt;&gt;', self.company_selected)
  
          # Department List
          query_ww= &quot;&quot;&quot;select distinct Department 
                      from MTK_MyAssetsTrack.dbo.v_MTK_OA_Client_Nologon_By_Days_Except_IT
                      where Company = ?
                      order by Department asc&quot;&quot;&quot;
          
          self.wwc = ' '
          df = pd.read_sql(query_ww, conn, params={self.wwc})
          self.d_set = df.loc[:,'Department']
          self.department =tk.Listbox(self.wrapper1, selectmode=tk.MULTIPLE, yscrollcommand=self.yScroll.set, width=40)
          self.department.grid(row=2, column=0, sticky=tk.N+tk.E+tk.W)
          self.department.insert(tk.END, *self.d_set)
          self.yScroll['command'] =self.department.yview
  
      def company_selected(self, event):
  
          if self.companyOpt.get():
              self.wwc = self.companyOpt.get()
          return self.wwc
           
  </code></pre>