Pyroot examples close after execution

Hi,

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 exampleName.py and after running completes the window closes. How could I get them to stay on the screen?

One example shows an error
python gui_ex.py

Error:

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

Thanks,
Tibor

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

python -i example.py