title: I want to limit how often a Tkinter callback is run
body: <p>I'm writing my first GUI program with Tkinter (first program in Python too, actually).</p>
  
  <p>I have an Entry widget for searching, and the results go to a Listbox. I want the results to update as the user types, so I made a callback like this:</p>
  
  <pre><code>search_field.bind("&lt;KeyRelease&gt;", update_results)
  </code></pre>
  
  <p>The problem is that updates the search many times in a row. Since the results will be coming from a database query, that generates a lot of unnecessary traffic. What I really want is for it to update every second or so, or to wait a second after the user stops typing and then search. What's the easiest way to do that?
  Thanks</p>
  
  <p>UPDATE: That works great for what I described, but now I've realized that I also need to trigger an update after the user stops typing. Otherwise, the last few characters are never included in the search. I think I have to un-accept the answer in order for this to go back into the list of questions...</p>