title: Getting the selected value from combobox in Tkinter
body: <p>I've made a simple combobox in python using Tkinter, I want to retrieve the value selected by the user. After searching, I think I can do this by binding an event of selection and call a function that will use something like box.get(), but this is not working. When the program starts the method is automatically called and it doesn't print the current selection. When I select any item from the combobox no method gets called. Here is a snippet of my code: </p>
  
  <pre><code>    self.box_value = StringVar()
      self.locationBox = Combobox(self.master, textvariable=self.box_value)
      self.locationBox.bind("&lt;&lt;ComboboxSelected&gt;&gt;", self.justamethod())
      self.locationBox['values'] = ('one', 'two', 'three')
      self.locationBox.current(0)
  </code></pre>
  
  <p>This is the method that is supposed to be called when I select an item from the box: </p>
  
  <pre><code>def justamethod (self):
      print("method is called")
      print (self.locationBox.get())
  </code></pre>
  
  <p>Can anyone please tell me how to get the selected value? </p>
  
  <p>EDIT: I've corrected the call to justamethod by removing the brackets when binding the box to a function as suggested by James Kent. But now I'm getting this error: </p>
  
  <p>TypeError: justamethod() takes exactly 1 argument (2 given)</p>
  
  <p>EDIT 2: I've posted the solution to this problem. </p>
  
  <p>Thank You.</p>