I’m having trouble running the examples in the TPython documentation page. I create a file called MyPyClass.py:
[code]print 'creating class MyPyClass … ’
def init( self ):
print ‘in MyPyClass.init’
def gime( self, what ):
and, then run ROOT (5.26/00b) and do:
mwilliam@lxplus303:~/ > root -l
root  TPython::LoadMacro( "MyPyClass.py" );
creating class MyPyClass ...
root  MyPyClass m;
root  char* s = m.gime( "aap" );
root  s
As you can see this is not returning “aap” but rather a random (presumably Unicode-type) string. In fact if I run the whole sequence again I get a different result of “�?)�S” or “�_��^” etc.
Given that I am running the example exactly as it is written I can’t see why this isn’t working. I’ve tried saving the .py file with different encodings such as UTF-8 and ASCII but it doesn’t seem to make a difference. Does anyone have any idea why this might be happening?