[Twisted-Python] Twisted with wxPython in a thread

Stephen Waterbury stephen.c.waterbury at nasa.gov
Tue Aug 24 09:24:42 EDT 2010


On 08/24/2010 09:22 AM, Gabriel Rossetti wrote:
> On 08/24/2010 03:06 PM, Stephen Waterbury wrote:
>> On 08/24/2010 05:40 AM, Gabriel Rossetti wrote:
>>
>>> Hello,
>>>
>>> I can't find any examples of using Twisted with wxPython, were wx is in
>>> a seperate thread. I used to have one somewhere but can' t find it
>>> either. I'm looking because for some reason my code doesn't work (the
>>> GUI freezes), even though I use reactor.callFromThread() for Twisted
>>> calls from wx and wx.CallAfter() for wx calls from Twisted. Can anyone
>>> point me to an example?
>>>
>> I've used a method for running twisted and wxPython in separate threads
>> that was developed by someone at Solipsis (http://netofpeers.com).
>> I've put the example that was on their web site (since removed) on mine:
>> http://pangalactic.us/txwx/separate_thread_example.html
>>
>> You can see a less trivial application of it here:
>> https://pangalactic.us/repo/ampchat
>>
>> ... in which I used that method in creating a wxpython-based client
>> to David Ripton's "ampchat" (wxchatclient.py).  This method has
>> worked for me, whereas I've observed the same (freezing) behavior
>> with wxreactor.
>>
>> Steve
>>
>
> Ok, so you put Twisted in a thread? I read in several posts that this
> posed problems, have you had any drawbacks?

I haven't observed any.

Steve



More information about the Twisted-Python mailing list