[IPython-dev] Best way to detect IPython notebook
Thu Feb 20 21:58:13 CST 2014
Here's the IPython check:
On Thu, Feb 20, 2014 at 10:56 PM, Jason Moore <firstname.lastname@example.org> wrote:
> Tarun's has some code that starts a SimpleHTTPServer which runs a three.js
> app on a new port. He's been trying to have the code open a new browser tab
> if you run the code from the notebook. See the last cell here:
> http://nbviewer.ipython.org/github/PythonDynamics/pydy-tutorial-pycon-2014/blob/master/notebooks/n08_visualization.ipynb(once IPython 2.0 is out, we plan to have this optionally open up in a
> notebook cell). The code that does this is mostly here:
> I think he was trying to detect whether you were in a notebook so that
> different behavior happens when the visualization server is opened. He'll
> have to comment more on the details.
> +01 530-601-9791
> On Thu, Feb 20, 2014 at 2:41 PM, Thomas Kluyver <email@example.com> wrote:
>> On 20 February 2014 08:45, TARUN GABA <firstname.lastname@example.org> wrote:
>>> if get_ipython().config['KernelApp']['parent_appname'] ==
>> Be aware that:
>> - This only tells you what started the kernel - you can start a kernel
>> with the notebook and attach a Qt console to it, and there's no good way to
>> tell which one has sent a piece of code.
>> - We want to get rid of that value eventually:
>> As Matthias mentioned, can you tell us a bit more about what it is that
>> you're trying to do?
>> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev