title: Tkinter callback function causing ValueError
body: <p>I am having problem with the callback function of the tkinter trace method. I would like to have 2 entries and the value of each entry depends on the value of another. So if I change the value of one, the value of the other is changed. This is some simple code doing this:</p>
  
  <pre><code>from tkinter import *
  
  class main():
  
      def __init__(self, master):
  
          self.a = DoubleVar(value=2.0)
          self.b = DoubleVar()
          self.b.trace("w",self.calc_c)
          self.c = DoubleVar()
          self.c.trace("w",self.calc_b)
  
          Entry(master,textvariable=self.b).grid(row=0,column=0)
          Entry(master,textvariable=self.c).grid(row=0,column=1)
  
      def calc_b(self,name,index,mode):
          self.b.set(self.c.get()/self.a.get())
  
      def calc_c(self,name,index,mode):
          self.c.set(self.b.get()*self.a.get())
  
  
  root = Tk()
  
  prog = main(root)
  
  root.mainloop()
  </code></pre>
  
  <p>The program is actually working, returning the right values, but also an error is produced:</p>
  
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
    File "/usr/lib64/python3.3/tkinter/__init__.py", line 1475, in __call__
      return self.func(*args)
    File "/home/anze/foo.py", line 22, in calc_c
      self.c.set(self.b.get()*self.a.get())
    File "/usr/lib64/python3.3/tkinter/__init__.py", line 332, in get
      return getdouble(self._tk.globalgetvar(self._name))
  ValueError: could not convert string to float: 
  </code></pre>
  
  <p>Can someone please explain the meaning of this error?</p>
  
  <p>Thank you!</p>