[IPython-dev] How can tell if code is executing within ipython / ipython notebook?

Shead, Timothy tshead at sandia.gov
Wed May 7 19:01:20 EDT 2014

I have some code that I’d like to execute only when run from within ipython … is there any way to know?  I’m already importing the required ipython modules in a try … catch block, so my code handles the case where IPython isn’t installed, but that doesn’t address the case where ipython is installed but not in use.

Thanks in advance,

Timothy M. Shead
Sandia National Laboratories
1461, Scalable Analysis and Visualization

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3216 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/11b6cd53/attachment.bin>

More information about the IPython-dev mailing list