<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>

I see you are using get_nowait() which according to the documentation, "return[s] an item if one is immediately available, else raise the Empty exception"
Now, you happen to break out of the loop when an Empty exception is thrown. Thus, if there is no result immediately available in the queue, your function returns an empty items list.
Is there a reason why you are not using the get() method instead? It may be the case that the get_nowait() fails because the queue is servicing a put() request at that same moment.