[SciPy-dev] gui_thread and wxPython-2.5.2.8

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Oct 1 14:24:09 CDT 2004


>>>>> "FP" == Fernando Perez <Fernando.Perez at colorado.edu> writes:

    >> Is this possible?  If it is I could probably eliminate the
    >> wxPython patch.

    FP> I think it is possible.  You can fool python's idea of what a
    FP> module is quite easily:

    FP> In [14]: sys.modules['code'] = sys.modules['time']

Well, what do you think I've been doing all day? ;-) Thanks anyway for
the suggestion.  I tried again armed with working code and tasted
success at last!  I have a patch for gui_thread that requires no
modifications to wxPython itself!  All that slogging was of use in the
end. :-)

Essentially, I have wxPython-2.5.x apps working from IPython via
gui_thread.  I don't have wxPython-2.4.x handy here but I don't think
I have changed anything in the code for that.  There is one irritating
warning message from pexec on exit from the interpreter but I can live
with that.

I think I'll check in my changes in a little while.  Please do test it
out and let me know if there are problems.  I'm particularly
interested in other platforms, Windows, Mac and also wxPython-2.4.x.

Here is a simple test you can run:

import gui_thread
gui_thread.start()
from gui_thread.examples import SimpleFrame
a = SimpleFrame()
a.Show()
a.SetTitle('Hey! this works!')


cheers,
prabhu




More information about the Scipy-dev mailing list