From: Arthur E. <ar...@ia...> - 2004-09-24 14:38:05
|
On Sep 24, 2004, at 08:51, Kevin Altis wrote: > Without seeing the code, it is difficult to say, but are you using > threads? If so, you can't access your GUI windows and components > directly from the thread(s) handling the sockets. You need to use > something that is thread-safe such as the Python Queue module. A > couple of samples use threading and Queue and others avoid threads by > using generators, but that probably wouldn't work for sockets. If you > use something like Twisted then you don't need threads. > > There are other possible problems, but again it is a bit difficult to > say without seeing some code. If you can zip it up and it isn't too > big, then maybe you can send it to the list, otherwise, email me > directly. > > You might also look at: > > http://wiki.wxpython.org/index.cgi/LongRunningTasks That's a very useful page. The example given uses the wx event mechanism and that seems a good solution for my problem. I now see passing a reference to the GUI in the thread was causing trouble. Thanks, I'll give it a try. Arthur |