Python and Sockets,

Walter Hofmann from-020801222532-1937 at secretlab.mine.nu
Thu Aug 1 16:28:10 EDT 2002


John J Breen schrieb im Artikel <3D486809.6F2DC882 at nospam.com>:
>     Hey all,
>             I am writing a program in Pygtk that also has a Python/TK
> component. I need these two components to be able to communicate with
> one another through a third component written in python. I would like to
> use sockets to send information back and forth, but am running into some
> trouble. The components may be sending information at any time so I need
> to the sockets to be able to listen/send at any time. I cant have a loop
> for listening because that would keep the user from sending events to
> either the gtk or TK interface.

You could use the select module to wait for a number of sockets to
become ready for reading or writing. However, I don't know if you can
process Tk or GTK evens simultaneously this way.

Walter



More information about the Python-list mailing list