title: Python Tkinter update when entry is changed
body: <p>I'm trying to make a simple temperature conversion calculator in python. What I want to do is to be able to type in a number, and have the other side automatically update, without having to push a button. Right now I can only get it to work in one direction. I can either code it so that it can go from F to C, or C to F. But not either way.</p>
  
  <p>Obviously <code>after</code> is not the way to go. I need some kind of <code>onUpdate</code> or something. TIA!</p>
  
  <pre><code>import Tkinter as tk
  
  root = tk.Tk()
  temp_f_number = tk.DoubleVar()
  temp_c_number = tk.DoubleVar()
  
  tk.Label(root, text="F").grid(row=0, column=0)
  tk.Label(root, text="C").grid(row=0, column=1)
  
  temp_f = tk.Entry(root, textvariable=temp_f_number)
  temp_c = tk.Entry(root, textvariable=temp_c_number)
  
  temp_f.grid(row=1, column=0)
  temp_c.grid(row=1, column=1)
  
  def update():
      temp_f_float = float(temp_f.get())
      temp_c_float = float(temp_c.get())
  
      new_temp_c = round((temp_f_float - 32) * (5 / float(9)), 2)
      new_temp_f = round((temp_c_float * (9 / float(5)) + 32), 2)
  
      temp_c.delete(0, tk.END)
      temp_c.insert(0, new_temp_c)
  
      temp_f.delete(0, tk.END)
      temp_f.insert(0, new_temp_f)
  
      root.after(2000, update)
  
  root.after(1, update)
  root.mainloop()
  </code></pre>