Queue question

spinner david at jotax.com
Sat Oct 15 17:50:36 EDT 2005


---------------------------------------------

A two parter newbie question I am afraid.

Am I right in thinking that using something like ...

item = a_queue.get()
print item

will not print 'item' unless or until there is an item in the queue to
retrieve.  Effectively stalling the thread at the .get() instruction?

I can see that this it may be tested for, using the .empty() function
thereby allowing the code to progress if there was nothing in the
queue, but how is .not_empty used ?

Thanks in advance
---------------------------------------------




More information about the Python-list mailing list