[IPython-User] Problem importing *

Simon Heisterkamp simon@heisterkamp...
Wed Oct 27 04:48:08 CDT 2010


Hi ipython experts,

I am using a python module called ROOT. It is the python interface of CERN's Root analysis framework. (root.cern.ch)
In a normal python session I can do:
>>> from ROOT import *
>>> g=TGraph()
And I will have a ROOT graph object.

In ipython i do the following:
In [1]: from ROOT import *
(Bool_t)1
In [2]: g=TGraph()
...
NameError: name 'TGraph' is not defined
So for some reason this does not work in ipython. Why not?

The strange thing is that the following works fine in ipython;
In [1]:  import ROOT
In [2]: g=ROOT.TGraph()
Works and g is completely usable as a ROOT graph object.

The following also works:
In [1]: from ROOT import TGraph
(Bool_t) 1
In [2]: g=TGraph()

It seems that the only thing that doesn't work is import *
Why is that?

Some information:
I am on a 64bit Mac using OSX10.6 and the standard installation of python.

Help will be appreciated. I have heard many good things about ipython and would really like to use it.

Thanks.

Regards.

Simon




More information about the IPython-User mailing list