[Twisted-Python] Excel, Twisted, and wxPython

Andrew Dalke dalke at dalkescientific.com
Mon Jun 2 15:33:37 MDT 2003


Uwe C. Schroeder:
> This is also the problem with the twisted wx support code. It works 
> nicely as
> long as you don't use a modal window. Then the code simply stops 
> working.
> That's why I posted a recipe on activestate's python cookbook, which 
> uses a
> timer to run the twisted reactor without actually running the reactor 
> loop.
> This is the only way I could get it working without using threads and 
> as I
> see in your Python2 file you figured that one out.

Okay, I used your recipe and got it to work.  Thanks!

I did have a problem with it.  wxApp under MS Windows starts a new 
window
to show stdout and stderr.  That window wasn't closed when the app 
finished,
which caused the error

  Debug: e:\projects\wx\src\msw\app.cpp(466): 'UnregisterClass(no redraw 
canvas)'
  failed with error 0x00000584 (class still has open windows.).

Deriving from wxPythonSimpleApp fixed it, and it turns out the real fix
is to set "redirect" to 0 in the wxApp constructor.  This prevents the
output window from opening.

I added this comment to the recipe as well.

					Andrew
					dalke at dalkescientific.com





More information about the Twisted-Python mailing list