[SciPy-dev] gui_thread and wxPython-

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Oct 2 08:16:15 CDT 2004

>>>>> "PR" == Prabhu Ramachandran <prabhu at aero.iitm.ernet.in> writes:

[ errors with earlier gui_thread ]

    PR> Hmm, thats very strange.  I don't get this error on 2.5.x
    PR> *but* on any complex application I do get hard to debug, wierd
    PR> and random errors.  So it appears that all is not well.  Also,
    PR> does wxPython-2.4.x have a 'wx/' directory in sys.path?  If
    PR> that is not the case, _import_wx_core should never be called
    PR> and the errors Fernando or you are seeing should not show up
    PR> since nothing should have changed in these cases from the
    PR> original behavior.  Unless the original behavior was itself
    PR> broken.

    PR> I'll try and check this stuff out on another machine tommorow.

I did not check it on another machine but have everything working
quite nicely on my machine with wxPython-  So much so that I
can run the wxPythonDemo and apart from one or two items which break,
pretty much everything else runs nicely (including the OpenGL canvas
demos).  Editing traits work, generating several windows also works.

In the earlier code I made some bad mistakes.  Particularly I did not
wait for the imports to complete.  I also did not import all the
extension modules which means some of them were not wrapped.  The
other problem was that there appeared to be a deadlock of some sort
which I've worked around by adding a small timeout to the wait.  This
appears to fix all the hanging interpreter issues.  The proof of the
pudding is that it runs bulk of wxPythonDemo nicely, which is good
enough for me. :)

Now, I haven't tested this under an older version of wxPython.  The
approach I use for the newer 2.5.x series is quite different from that
used in the original code.

Could someone who has wxPython-2.5.x installed please help testing the
code out.  I've spent several hours on this and could use a little
help with the testing on other machines/platforms.

I'll go over my code once and then check my changes in in an hour or
so.  Once that code is in, if others can test on their wx-2.5.x
installations and see if it works ok, we can look at improving the
2.4.x behavior.  I believe the same approach that I use for wx-2.5.x
will work nicely for wxPython-2.4.x.  The idea is that I create a
dummy 'wx' or 'wxPython' module, manually find all the extension
modules to import, import them, generate the wrapper functions for
these, reload the *real* module, then start the threading stuff.  This
works nicely because all the extension modules are wrapped.


More information about the Scipy-dev mailing list