[IPython-dev] How to know if code is executing in a rich display (qtconsole or notebook)
kikocorreoso at gmail.com
Fri Feb 26 04:59:38 EST 2016
Is there a sane way to know if some code is executing in a rich display
environment like the qtconsole or the notebook?
I think the following could work:
from ipykernel.zmqshell import ZMQInteractiveShell
ip = get_ipython()
rich_display = isinstance(ip, ZMQInteractiveShell)
rich_display = False
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev