<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-839046" style><p style="margin:1.2em 0px!important">On Fri, May 9, 2014 at 1:25 PM, Roman Max. <<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>> wrote:</p>


<p style="margin:1.2em 0px!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div><div dir="ltr">OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded?</div></div></blockquote><p></p></div><p style="margin:1.2em 0px!important">

</p>
<p style="margin:1.2em 0px!important">Yes. Or you can add custom javascript to the page to take action based on the parameters once the page is loaded.  But again, I wouldn’t recommend doing this, because it may conflict with server changes in the future. If you go this route, I would suggest using <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248)">#</code> instead of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248)">?</code>, since it would really be client-side only information.</p>


<p style="margin:1.2em 0px!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><div dir="ltr"><div><br></div><div>do you plan for such an enhancement (passing parameters via URL to notebooks)? <br></div></div></div></blockquote><p></p></div><p style="margin:1.2em 0px!important"></p>
<p style="margin:1.2em 0px!important">No. The HTML/Javascript context of the page and notebook server are strongly decoupled from the Python environment of the Kernel. We have no plan to change this.</p>
<p style="margin:1.2em 0px!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><div dir="ltr"><div>or which class would I need to modify to implement support for this?<br></div></div></div></blockquote><p></p></div><p style="margin:1.2em 0px!important"></p>
<p style="margin:1.2em 0px!important">At least a few:</p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel.</li>
<li style="margin:0.5em 0px">the KernelManager, which starts the kernel, which would need to be told about these parameters</li>
<li style="margin:0.5em 0px">possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process.</li>
</ul>
<p style="margin:1.2em 0px!important">Depending on how much javascript you customize, there are probably a few combinations of classes to modify.</p>
<p style="margin:1.2em 0px!important">Can we back up a bit, and ask what you want to accomplish by passing these parameters? There may be a simpler solution than subclassing the entire notebook server.</p>
<p style="margin:1.2em 0px!important">-MinRK</p>
<p style="margin:1.2em 0px!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><div dir="ltr"><div><div><hr>From: <a href="mailto:benjaminrk@gmail.com" target="_blank">benjaminrk@gmail.com</a><br>Date: Thu, 8 May 2014 16:03:15 -0700<div><div class="h5"><br>To: <a href="mailto:ipython-dev@scipy.org" target="_blank">ipython-dev@scipy.org</a><br>

Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL?<br><br><div dir="ltr"><br><div><br><br><div>On Thu, May 8, 2014 at 11:51 AM, Roman Max. <span dir="ltr"><<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>></span> wrote:<br>



<blockquote style="border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><div dir="ltr">Many thanks for the reply, I see. Indeed I am looking for a way to pass parameters to the Python code on the kernel, e.g. .NET app calling out a notebook with parameters and displaying output.<div>So, essentially the notebook server doesn't support this sort of interaction at the moment? I assume I could do it by cloning and modifying .ipynb template file before each request, still hoping there is a better way than that.<br>



</div></div></div></blockquote><div><br></div><div>No, the server definitely doesn't support URLs affecting the kernel. If you want to execute code on the Kernel, you would do this via the Javascript APIs.</div><div>


<br>
</div><div>-MinRK</div><div><br></div><div> </div><blockquote style="border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div dir="ltr"><div><br><div><hr>From: <a href="mailto:benjaminrk@gmail.com" target="_blank">benjaminrk@gmail.com</a><br>



Date: Thu, 8 May 2014 10:47:16 -0700<br>To: <a href="mailto:ipython-dev@scipy.org" target="_blank">ipython-dev@scipy.org</a><br>Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL?<div>



<div><br><br><div dir="ltr">You can do this, but I wouldn't recommend it. The parameters will only be available to the HTML/JS in the notebook page, and not the Python code on the kernel.  Plus, there is a chance that it would conflict with any future use of url parameters by the notebook server.<div>





<br></div><div>-MinRK</div></div><div><br><br><div>On Thu, May 8, 2014 at 10:11 AM, Roman Max. <span dir="ltr"><<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>></span> wrote:<br>

<blockquote style="border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><div dir="ltr"><p style="border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;background-color:rgb(255,255,255)">





is it possible to pass parameters to IPython notebook via URL?</p><p style="border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;background-color:rgb(255,255,255)">





How to reference/use those parameters in a notebook?</p><p style="border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;background-color:rgb(255,255,255)">





e.g. <a href="http://xxxyyzz.org:8888/mynotebook.ipynb" rel="nofollow" style="padding:0px;border:0px;vertical-align:baseline;color:rgb(74,107,130);text-decoration:none;background-color:transparent" target="_blank">http://xxxyyzz.org:8888/mynotebook.ipynb</a><strong style="padding:0px;border:0px;vertical-align:baseline;background-color:transparent">?d1=20140101&d2=20140401</strong></p>





<p style="border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;background-color:rgb(255,255,255)"><br>

</p><p style="border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;background-color:rgb(255,255,255)">

Did not find an answer after searching around. Thanks!</p>                                          </div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________
IPython-dev mailing list
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a></div></div></div></div>                                       </div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________
IPython-dev mailing list
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a></div></div></div></div>                                       </div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote><p></p></div><p style="margin:1.2em 0px!important"></p>
</div></div>