Re: Loading classes from multiple Python files

From: Marius Bjørnstad <paul.bjoernstad_at_hep.manchester.ac.uk>
Date: Tue, 15 Mar 2011 12:40:24 +0100


Hi all,

I decided to put all the classes in one file as a workaround, but it still does not work! I define two classes in a single python file, and then load the file with TPython::LoadMacro. I then can't access methods of the class that was defined first from ROOT.

Cheers,
Marius

On 14/03/2011 17:21, Marius Bjørnstad wrote:
> Hi,
>
> Thanks for checking it out!
>
> On 14/03/2011 17:00, Brett Viren wrote:

>> You need to define the methods to take "self" as their first argument.
>> You can run your example in plain Python to see it isn't liked there
>> either.

> Sorry, my Python is a bit rusty (I didn't actually write the code I'm
> debugging).
>
>> But, besides that, the error you get is confusing.  It seems to hint at
>> some problem in TPython.
>>

> I forgot to say, I get no error in my example on v5.26/00c (when fixing
> that silly mistake). The main program that I'm debugging also works, but
> we have to move to 5.28, as the entire software stack is based on that.
>
> I am using a ROOT installation at CERN (LHCb), if that matters:
> [lxplus304] /afs/cern.ch/user/p/pbjornst > which root
>
> /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00a/x86_64-slc5-gcc43-opt/root/bin/root
>
> Cheers,
> Marius
>
Received on Tue Mar 15 2011 - 12:40:34 CET

This archive was generated by hypermail 2.2.0 : Tue Mar 15 2011 - 17:50:01 CET