[IPython-dev] Best way to detect IPython notebook
Thu Feb 20 21:56:41 CST 2014
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:
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.
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