Hi,
I am trying to use both Form and Format from TString in pyroot. In C++ I see:
root [0] TString str
(TString &) ""[0]
root [1] str.Form("%.3f",1.3)
root [2]
root [2] str
(TString &) "1.300"[5]
root [3]
root [3] auto str1 = TString::Format("%.3f", 1.3)
(class TString &) "1.300"[5]
root [4]
root [4]
And in python:
>>> import ROOT
>>>
>>> str1=ROOT.TString()
>>> str1.Form("%.3f",1.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: void TString::Form(const char* fmt) =>
takes at most 1 arguments (2 given)
>>>
>>> str2=ROOT.TString.Format("%.3f",1.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: static TString TString::Format(const char* fmt) =>
takes at most 1 arguments (2 given)
I don’t understand why this doesn’t work. I am using root 6.06.06-x86_64-slc6-gcc49-opt in Debian.
Cheers.