Pyroot examples close after execution


This is a silly question but I spent about an hour trying to figure it out and google it so I’ll just ask.

I am running the pyroot examples from here:

This way:

python and after running completes the window closes. How could I get them to stay on the screen?

One example shows an error


Traceback (most recent call last):
  File "", line 57, in <module>
    window = pMainFrame( ROOT.gClient.GetRoot(), 200, 200 )
SystemError: const TGWindow* TGClient::GetRoot() =>
    problem in C++; program state has been reset


Using the code below in the python interpreter works, is there a simpler way?

python -i