[IPython-user] TraitsUI and ipython
Fernando.Perez at colorado.edu
Sun Dec 3 22:00:32 CST 2006
Robert, I'm not sure why this bounced coming from you; I just added you to the
manual whitelist to avoid problems in the future.
Re: TraitsUI and ipython
Robert Kern <robert.kern at gmail.com>
Sun, 03 Dec 2006 19:03:10 -0600
ipython-user at scipy.net
> > I'm just starting to work with the Enthought Traits module which looks
> > to have a very handy basic GUI for setting configuration data in
> > scripts and handling bits of persistent data with a trivial level of
> > effort. It seems like it would be a great addition to the
> > ipython/pylab/YFE (your favotite editor) setup. However, so far, I
> > have not been able to get python and pylab to cooperate on OS X. I'm
> > using wxpython in pylab. When I start ipython with -pylab or use
> > ipython -wthread and then run a TraitUI script the GUI window appears
> > along with a spinning-disk cursor for several seconds, followed by a
> > python/wxpython crash.
What are you using to bring up the Traits sheet? .configure_traits() is used for
when the Traits sheet *is* the application; i.e., it should not be used when a
wx.App() has already been created like it is with "ipython -wthread". Use
.edit_traits() instead. I apologize for the near-indistinguishable names;
personally, I'd prefer that .configure_traits() be called
This is what I get (Intel OS X, Python 2.5, "ipython -wthread"
svn-mumble-mumble, wxPython 2.6.3.x, enthought bleeding-svn):
In : from enthought.traits.api import *
In : class Foo(HasTraits):
...: bar = Str
In : f = Foo()
In : f.edit_traits() # It works!
Out: <enthought.traits.ui.ui.UI object at 0x179f2ea0>
In : f.configure_traits() # It fails!
In : zsh: bus error ipython -wthread
-- Robert Kern "I have come to believe that the whole world is an enigma, a
harmless enigma that is made terrible by our own mad attempt to interpret it
as though it had an underlying truth." -- Umberto Eco
More information about the IPython-user