[Tutor] asyncore, asynchat, sockets, and threads

Magnus Lyckå magnus@thinkware.se
Mon Jul 14 21:12:02 2003


At 20:50 2003-07-14 -0400, Michael Welsh wrote:
>I've tried several approaches and can't seem to get it right.  First I tried
>setting up a separate threading.Thread that created the socket.  This way I
>could put a poll on the socket.  I even created (borrowed) a custom event so
>when data was found, it could notify the GUI and call the "add to list
>control"  But I must have been doing it wrong because it kept locking up in
>the loop..

You can only access the GUI in one thread. See
http://wiki.wxpython.org/index.cgi/LongRunningTasks or
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language