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

Ville M. Vainio vivainio@gmail....
Tue Aug 7 01:28:51 CDT 2007


On 8/7/07, David Cournapeau <david@ar.media.kyoto-u.ac.jp> wrote:


> (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.


ipapi.get returns None if you are not running under ipython:

D:\Python25>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import IPython.ipapi
>>> IPython.ipapi.get()
>>> print IPython.ipapi.get()
None
>>>

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070807/db283aaf/attachment.html 


More information about the IPython-user mailing list