Pyroot

Dear experts,
I have this simple macro [1], but when when I run it, the canvas disappear quickly. I wonder how can I avoid this? When I used the normal C++ code I do not have this problem.
Regards

[1]
from ROOT import gROOT, TCanvas, TF1

gROOT.Reset()
c1 = TCanvas( ‘c1’, ‘Example with Formula’, 200, 10, 700, 500 )
fun1 = TF1( ‘fun1’, ‘abs(sin(x)/x)’, 0, 10 )
c1.SetGridx()
c1.SetGridy()
fun1.Draw()
c1.Update()

from python prompt, use:

If you terminate the script, all the objects are ‘garbage collected’, including the TCanvas. To keep them alive, you can also execute the script and stay in the interpreter with the ‘-i’ option:

python -i my_script.py 

Dear mato and bellenot,
thank you for your answers, it help.
Regards