[IPython-user] Running matplotlib both at ipython prompt and in scripts

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Aug 6 23:20:26 CDT 2007


Hi,

    I am not sure the problem is ipython or not, but I still have thread 
related issues, which I think come from the fact that I am running 
script which use pylab in it. To put it simply:

# simple.py
import pylab as P
P.plot([1, 2, 3])

Those scripts are meant to be executed directly using python -c, but 
sometimes, I would also like to use them inside an ipython shell 
(launched by ipython -pylab), through %run. I was thinking about 
conditionaly importing pylab, but I am not sure how to detect whether a 
script is run under ipython.

cheers,

David


More information about the IPython-user mailing list