title: Smooth movement with Tkinter?
body: <p>I'm trying to make a movable sprite in Tkinter; it works, but I'm not sure binding a Canvas with  is the best solution. There is a delay after I press "w", for example, where the character moves once, stops for a few seconds, then starts moving a bit laggily.</p>
  
  <p>Code:</p>
  
  <pre><code>import Tkinter as t
  
  tk = t.Tk()
  w = t.Button()
  c = t.Canvas(tk, bg = "#000000", bd = 3)
  x = 20
  y = 20
  
  img = t.PhotoImage(file = "hi.png")
  c.create_image(x, y, image = img)
  coord = 10, 50, 240, 210
  
  def clearboard():
      c.delete("all");
  
  
  def key(event):
      global y
      global x
      pr = event.char
      if(pr is "w"):
          y -= 5
      if(pr is "s"):
          y += 5
      if(pr is "a"):
          x -= 5
      if(pr is "d"):
          x += 5
      c.delete("all");
      c.create_image(x, y, image = img)
  
  
  
  w = t.Button(tk, command = clearboard, activebackground = "#000000", activeforeground = "#FFFFFF", bd = 3, fg = "#000000", bg = "#FFFFFF", text = "Clear", relief="groove")
  
  
  c.focus_set()
  c.bind("&lt;Key&gt;", key)
  
  w.pack()
  c.pack()
  tk.mainloop()
  </code></pre>
  
  <p>My question is, how do I remove that delay mentioned earlier and make the movement a bit smoother?</p>
  
  <p>Thanks in advance.</p>