title: Update label based on Key in Dropdown menu Tkinter Python
body: <p>Hi I am trying to update a label based on the key selected from a drop down menu (using a dictionary). I am unsure as to how i can update the label. Thankyou. I have made an attempt as below however I am obviously doing it wrong due to lack of knowledge.   Thankyou </p>
  
  <pre><code>from tkinter import *
  from tkinter.ttk import *
  import csv
  
  
  class DictionaryGui:
  '''Display a GUI allowing key-&gt;value lookup'''
  def __init__(self, parent, row, column, dictionary):
      self.dictionary = dictionary
      self.selection = StringVar()
      self.value = StringVar()
  
      username_label = Label(parent, text="Key:")
      username_label.grid(row=row, column=column)
      keys = list(sorted(dictionary.keys()))
      self.selection.set(keys[0])
      select = Combobox(parent, textvariable=self.selection,
                        values=keys,
                        width=8, command=self.update())
      select.grid(row=row, column=column+1)
  
  
  
  
      name = Label(parent, textvariable=self.value)
      name.grid(row=row, column=column+3)
  
  def update(self):
      self.value.set(self.dictionary[self.selection.get()])
  
  
  
  
  
  def main():
    window = Tk()
    test_dict = {'first_name': 'Fred', 'last_name': 'Bloggs', 'age' : 20}
    gui = DictionaryGui(window, 0, 0, test_dict)
    window.mainloop()
  
  main() 
  </code></pre>