I have googled around and looked through the documents, but I can't
seem to find a description of the difference between running a script
inside and outside ipython (using ipython --pylab). For example, I
tried doing the following in a script and made it executable.
from __future__ import print_function
import matplotlib.pyplot as plt
for a in xrange(0,2):
In ipython, it just prints 0 and 1 and shows one figure then stops.
Outside ipython, for example just running from the command line, it
prints 0, shows a plot, and stops to wait for me to close the plot.
Then it prints one and shows a second plot (which is the behavior I am
My question is how to I get the script to behave the same (as if I ran
it fro the command line) both inside and outside ipython? If it isn't
possible directly, is there a way to pause execution in ipython to wait
until I close the plot before showing the next?