I am using pyroot and I want to:
- open an output file
- on a loop: open a TDirectory with a name defined in the loop, write in it
- save the file
All the TDris have to be at the same level, in the file.
Can you send me a scratch of code to do this? I am doing:
outfile = ROOT.TFile(outputdir + folder.split("/")[-1],"RECREATE") for basename in basenames: TDir = ROOT.TDirectory(basename, "") TDir.Write() outfile.Write() outfile.Close()
but I in the end do not see the TDirs in the file. Am I doing something wrong?
ROOT Version: 6.24/08