Dear all,
Though I wonder if I should simply address this to Wim
Iām starting to use IPython to run my mixed C++/python/ROOT analysis, as I saw that itās the most commonly used tool for pyroot users. When I reload a C++ class via gROOT, IPython gets confused and normally crashes when I try to use the changed class. An example is below.
In plain python, one canāt unload / reload libraries, so Iām used to simply exiting the python prompt and restarting (with an init macro). IPythonās approach seems to be that it is possible to unload modules, so development can proceed without existing the IPython environment. Can this be made to work with pyroot?
(I will be perfectly happy with an answer of ānoā. Frankly, I still amazed at all the things that do work with pyroot.)
Example:
[quote]$ ipython
In [1]: import ROOT as R
In [2]: R.gROOT.LoadMacro(ātest_ip.h+ā)
In [3]: tt = R.tip()
In [4]: R.gROOT.LoadMacro(ātest_ip.h++ā)
In [5]: tt.method()
terminate called after throwing an instance of 'std::length_errorā
what(): vector::_M_fill_insert
Aborted[/quote]
Where test_ip.h is simply:
[code]#include
using std::endl;
using std::cout;
class tip
{
public:
int _foo;
double _bar;
void method()
{
cout<<"tip::method called. foobar are: ā<<_foo<<ā, "<<_bar<<endl;
}
};
[/code]
thanks,
Amnon Harel,
University of Rochester