[SciPy-dev] gui_thread and wxPython-2.5.2.8

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Oct 1 12:31:22 EDT 2004


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

    FP> Prabhu Ramachandran schrieb:
    >> Any advice would be appreciated.  In any case the result of my
    >> hacking is that with 2 small patches one can use gui_thread
    >> fully from within IPython for both new and old (not tested but
    >> should work) versions of wxPython.
    >>
    >> Also, if 0.3.2 is round the corner is this a good thing to push
    >> into scipy?  I am not sure how many folks use gui_thread, but
    >> it would certainly be cool if this could make it into 0.3.2.

    FP> This is great, as far as I'm concerned.  I'm sorry I can't

Thanks for the feedback!  Much appreciated.

    FP> currently help, as I'm too swamped on the next ipython
    FP> release.  But since that work is geared to make
    FP> ipython+matplotlib work as smoothly as possible with wx and
    FP> gtk, having this in the scipy release would be a great
    FP> complement.

In theory, gui_thread could be extended to work for PyGtk also but
that will take time and effort and most of all a reasonably intimate
knowledge of PyGtk.

    FP> These gui/threading issues are _way_ over the head of most
    FP> day-to-day scientists (including myself :), so the more we can

Well, I took a long while tracking this one down.  Considering that I
wrote an earlier version of this a long while ago, I can completely
understand the difficulty.  I think Pearu's approach is really quite
elegant and works well.  My primary difficulty was figuring out where
the problem was!

I have a question that you might be able to help with.  I want to do
this:

    Create a module that shadows an existing module in the filesystem.
    Lets say, site-packages/wx/__init__.py.  I want to create a new
    module with code that does something else (and not have to create
    a file!).  Like say: "def f(): print 'hello world'", call that the "wx"
    module, and make Python believe nothing is wrong (insert it into
    sys.modules or whatever) then do a 'reload(wx)' to re-read the
    real __init__.py just like normal.  I'd like the code to be simple
    and not have to use complex import hooks.

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

cheers,
prabhu




More information about the SciPy-Dev mailing list