title: Get all items from thread Queue
body: <p>I have one thread that writes results into a Queue.</p>
  
  <p>In another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:</p>
  
  <pre><code>def queue_get_all(q):
      items = []
      while 1:
          try:
              items.append(q.get_nowait())
          except Empty, e:
              break
      return items
  </code></pre>
  
  <p>Is this a good way to do it ? </p>
  
  <p><strong>Edit:</strong></p>
  
  <blockquote>
    <p>I'm asking because sometimes the
    waiting thread gets stuck for a few
    seconds without taking out new
    results.</p>
  </blockquote>
  
  <p>The "stuck" problem turned out to be because I was doing the processing in the idle event handler, without making sure that such events are actually generated by calling <code>wx.WakeUpIdle</code>, as is recommended.</p>