User Tools

Site Tools


root:ownershippyroot

This is an old revision of the document!


Ownership in PyROOT

As python has a garbage collector, you have to make sure to pass on all objects that you want to keep. For example canvases.

The following macro will produce 10 empty canvases and delete them in the end.

from ROOT import *
import ROOT
 
for i in range(0,10):
    canv = TCanvas("canv"+str(i))
root/ownershippyroot.1308391922.txt.gz · Last modified: 2011/06/18 12:12 by decianm