Python and Sockets,

Itamar Shtull-Trauring itamarst at yahoo.com
Mon Aug 5 00:04:00 EDT 2002


John J Breen <jbreen at nospam.com> wrote in message news:<3D486809.6F2DC882 at nospam.com>...

>             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. Someone suggested _createfilehandler but
> Im not sure what that is... Does anyone have any suggestions for such a
> problem?

Twisted (http://www.twistedmatrix.com) lets you integrate your graphic
toolkit's event loop with your networking event loop. No threads, no
complications - it just works. It supports Tk, GTK+, Qt and wxPython,
so it should integrate nicely with both your programs.



More information about the Python-list mailing list