title: Threading with Tkinter bind and canvas
body: <p>I am having problems with Tkinter's <code>canvas.coords()</code> method. I am trying to update the canvas every 1/60 of a second and trying to detect when the Right arrow key is pressed. The problem is that when I keep the right arrow pressed for a while I get an error :</p>
  
  <p><a href="http://postimage.org/image/bdfk3m8gx/" rel="nofollow">http://postimage.org/image/bdfk3m8gx/</a></p>
  
  <p>My script is 'novo.py' and the code is given below. Any help perhaps? I'm just a begginer.</p>
  
  <pre><code>import Tkinter, threading, time
  
  def real_time(td, canvas):
      while True:
          time.sleep(1/60.0)
          canvas.coords('line',1,1,200,200)
  
  def func(event):
      print 'key pressed'
  
  
  root = Tkinter.Tk()
  canvas = Tkinter.Canvas(root)
  canvas.pack()
  canvas.create_line(1,1,100,100, tag='line')
  root.bind('&lt;Right&gt;', func)
  thread = threading.Thread(target = real_time, args = (1/60.0, canvas))
  thread.start()
  root.mainloop()
  </code></pre>