Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

continuous return?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


fordhaivat at gmail

Nov 3, 2009, 7:20 PM

Post #1 of 2 (42 views)
Permalink
continuous return?

I'm trying to write something related to IRC. The thing is, I have one
thread receiving and another sending. But, how can I keep the caller of the
recv() function informed about what was last received so that it can all be
printed out. But, I no idea how I can accomplish this. I was thinking about
getting one variable that was constantly updated with the latest line that
was recved and that the variable would be a member of the class so other
functions/classes can access it


gagsl-py2 at yahoo

Nov 3, 2009, 7:31 PM

Post #2 of 2 (41 views)
Permalink
Re: continuous return? [In reply to]

En Wed, 04 Nov 2009 00:20:05 -0300, Someone Something
<fordhaivat[at]gmail.com> escribió:

> I'm trying to write something related to IRC. The thing is, I have one
> thread receiving and another sending. But, how can I keep the caller of
> the
> recv() function informed about what was last received so that it can all
> be
> printed out. But, I no idea how I can accomplish this. I was thinking
> about
> getting one variable that was constantly updated with the latest line
> that
> was recved and that the variable would be a member of the class so other
> functions/classes can access it

I don't completely understand your scenario, but since you say you have
several threads, a common way to communicate between them is to use a
Queue object. Let the receiver thread put() lines into the queue, and the
processing thread get() them and do some work.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.