[Tutor] Socket events and wxPython events?

Mike Eve michael.j.eve at gmail.com
Mon Dec 6 01:21:20 CET 2004


To learn Python, I'm adapting a board game to a network based games with server and clients. It took a while, but with a little help, I've learned about wxPython, wxglade, SPE so that I now have a prototype GUI up and running.

Now to get the network part up and running... The network will be sending commands, responses, and random queries.

I'm thinking about 3 approaches, but rather than beat my head against the wall, I was hoping to find out if any  of these are workable:

1) use sockets lib. Do socket send/recv generate any kind of event with an event id that can used with the wxPython window events? That is, I want to just sit and receive events such as OnPaint, OnButton, in the same loop as I receive "OnReceiveSocket" (or whatever it might be called).

2) create a separate thread which does a select then sends a wxPython compatible event which can be intermixed with OnPaint, etc (similar to option 1)

3) use SocketServer. I noticed the  SocketServer class refers to "request handler class" and "handle" functions. Do these generate any events which are wxPython compatible

You probably noticed I'm a little confused about what a wxPython compatible event is. I'm not sure if these events and their event handling are part of Python or something added by  and unique to wxPython.

Thanks, Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041205/8625f0ad/attachment.htm


More information about the Tutor mailing list