Re: Queue() question. This post is pretty long.

2009-04-16 Thread grocery_stocker
On Apr 16, 11:46 am, Piet van Oostrum wrote: > > grocery_stocker (g) wrote: > >g> [cdal...@localhost ~]$ python > >g> Python 2.4.3 (#1, Oct 1 2006, 18:00:19) > >g> [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 > >g> Type "help", "copyright", "credits" or "license" for more information. >

Re: Queue() question. This post is pretty long.

2009-04-16 Thread Piet van Oostrum
> grocery_stocker (g) wrote: >g> [cdal...@localhost ~]$ python >g> Python 2.4.3 (#1, Oct 1 2006, 18:00:19) >g> [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 >g> Type "help", "copyright", "credits" or "license" for more information. > import Queue > queue = Queue.Queue() > >>

Queue() question. This post is pretty long.

2009-04-16 Thread grocery_stocker
I don't get how item = self.__queue.get() gets advanced to if item is None: in the following code. >>> import time >>> from threading import Thread >>> import Queue >>> >>> WORKER = 2 >>> >>> class Worker(Thread): ... def __init__(self, queue): ... Thread.__init__(self) ...