Hi all,
it the loop bellow problem occurs. I wanna save some graphs to mutual file.root but in different directories. I mean to do it like this
scan_number = 1
f1= TFile(“file.root”,“UPDATE”)
directory = (“Scan%d”) %scan_number
if directory.cd()==True:
** directory.cd()**
** g.Write()**
else:
** f1.mkdir(directory)**
** directory.cd()**
** g.Write()**
f1.Close()
But I`m getting the error
AttributeError: ‘str’ object has no attribute 'cd’
I also tried
directory = “Scan”+ str(scan_number)
but same problem occured
How can I make convert directory name so I can use cd() command on it?
Thanks in advance,
V.