Newbie: Running two threads...

anton muhin antonmuhin.REMOVE.ME.FOR.REAL.MAIL at rambler.ru
Wed Nov 26 16:09:45 EST 2003


Siddharth Choudhuri wrote:

> I am trying to come up with an app that reads data out of socket
> (concurrent server) and display a graph on the UI. I have one program that
> uses asyncore.loop() to read data out of a port. The second program uses
> Tkinter to have  the UI and uses mainloop() to respond to mouse-click and
> other events.
> 
> Now, the problem is how do I combine the two ? since there are two event
> loops. If I put the asyncore.loop() within the UI, the code blocks waiting
> for input and does not update the UI.
> 
> TIA
> -siddharth
> 
> _____________________________________________________________________
>      Unix is user friendly - its just picky about its friends.
> _____________________________________________________________________
IMHO standard solution is to use Queue---socket process polpulates a 
queue and UI pulls data from it.

regards,
anton.





More information about the Python-list mailing list