Multiple threads in a GUI app (wxPython), communication between worker thread and app?

fooooo phark52 at yahoo.com
Sun May 1 13:03:11 EDT 2005


This is a network app, written in wxPython and the socket module. This
is what I want to happen:

GUI app starts. User clicks a button to 'start' the work of the app.
When start is pressed, a new thread is spawned (threading module) and
this thread starts listening for data on a socket. When someone
connects, a new thread is spawned, It needs to do I/O on that socket
and open a GUI window so the user can communicate with the client
(socket) that just connected. Any further data that comes in on that
socket should be redirected to the newly opened GUI window. Any more
connection attempts will open a new GUI window and the same cycle
repeats.

How would I get the worker thread to open a GUI window in the main GUI
thread? After that GUI window is open, how can I send and recv messages
from/to the GUI window?




More information about the Python-list mailing list