<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi, John,<div><br></div><div>thanks for the suggestion, will have a look into the project. Although my use case assumes interaction the other way -- from .NET to Python.<br><br><div><hr id="stopSpelling">From: jgill@tokiomillennium.com<br>To: ipython-dev@scipy.org<br>Date: Mon, 12 May 2014 13:14:23 +0000<br>Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL?<br><br>



<style><!--
.ExternalClass .ecxshape {
}
--></style><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}

.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}

.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

.ExternalClass code {
font-family:"Courier New";
}

.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate {
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
}

.ExternalClass span.ecxEmailStyle20 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}

.ExternalClass span.ecxBalloonTextChar {
font-family:"Tahoma","sans-serif";
}

.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}

.ExternalClass div.ecxWordSection1 {
}

.ExternalClass ol {
}

.ExternalClass ul {
}

--></style>


<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">If you are working with python and .NET you should take a look at pythonnet:</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"><a href="https://github.com/pythonnet/pythonnet" target="_blank">https://github.com/pythonnet/pythonnet</a></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">It allows you to work seamlessly with .NET objects from python.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">John</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";"> ipython-dev-bounces@scipy.org [mailto:ipython-dev-bounces@scipy.org]
<b>On Behalf Of </b>Roman Max.<br>
<b>Sent:</b> Sunday, May 11, 2014 3:51 AM<br>
<b>To:</b> IPython developers list<br>
<b>Subject:</b> Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL?</span></p>
</div>
</div>
<p class="ecxMsoNormal"> </p>
<div>
<p class="ecxMsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif";">Many thanks for following up on this thread. I would like to use IPython notebook to perform and present some analytics in a .NET application. I've got a CefSharp (chrome)
 component integrated and can display notebook's output. Now trying to figure out how to pass parameters, so notebook calculates some analytics per selected object. E.g. depending on a selected object .NET prepares a CSV data input file, then the path of this
 file would need to be passed to an IPython notebook for further processing. <br>
<br>
After looking at your Singlecell.py code I think I start to understand where you are heading with giving hints with respect to JavaScript. Essentially .NET app could prepare HTML/Javascrpit part each time a new object is selected and pass it then over to IPython
 kernel for execution? Porbably will work, just doesn't look so clean, since python logic code will be in javascript files.</span><span style="font-family:"Calibri","sans-serif";"></span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif";">would be still nice to have a way to communicate with the IPython only via URL, as not always client side presentation part(Javascript) can be involved.</span><span style="font-family:"Calibri","sans-serif";"></span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif";">RM</span><span style="font-family:"Calibri","sans-serif";"></span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div class="ecxMsoNormal" align="center" style="text-align:center;"><span style="font-family:"Calibri","sans-serif";">
<hr size="2" width="100%" align="center" id="ecxstopSpelling">
</span></div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">From: benjaminrk@gmail.com<br>
Date: Fri, 9 May 2014 13:43:07 -0700<br>
To: ipython-dev@scipy.org<br>
Subject: Re: [IPython-dev] is it possible to pass parameters to IPython notebook via URL?</span></p>
<div>
<div id="ecxmarkdown-here-wrapper-839046">
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">On Fri, May 9, 2014 at 1:25 PM, Roman Max. <<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>> wrote:</span></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;">
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">OK, thanks for clarifying it once again. Javascript API means user needs to interact with the page once it's already loaded?</span></p>
</div>
</div>
</blockquote>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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 </span>
<code><span style="font-size:10.0pt;font-family:Consolas;border:solid #EAEAEA 1.0pt;padding:0in;background:#F8F8F8;">#</span></code><span style="font-family:"Calibri","sans-serif";"> instead of
</span><code><span style="font-size:10.0pt;font-family:Consolas;border:solid #EAEAEA 1.0pt;padding:0in;background:#F8F8F8;">?</span></code><span style="font-family:"Calibri","sans-serif";">, since it would really be client-side only information.</span></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;">
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">do you plan for such an enhancement (passing parameters via URL to notebooks)? </span></p>
</div>
</div>
</div>
</blockquote>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;">
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">or which class would I need to modify to implement support for this?</span></p>
</div>
</div>
</div>
</blockquote>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">At least a few:</span></p>
<ul>
<li class="ecxMsoNormal" style="">
<span style="font-family:"Calibri","sans-serif";">the NotebookHandler, which renders the notebook page, which will receive the URL with parameters, but is not the URL that starts the kernel.</span></li><li class="ecxMsoNormal" style="">
<span style="font-family:"Calibri","sans-serif";">the KernelManager, which starts the kernel, which would need to be told about these parameters</span></li><li class="ecxMsoNormal" style="">
<span style="font-family:"Calibri","sans-serif";">possibly the Kernel itself, for taking the actual actions you wish these parameters to imply in the kernel process.</span></li></ul>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Depending on how much javascript you customize, there are probably a few combinations of classes to modify.</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">-MinRK</span></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;">
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div>
<div>
<div>
<div class="ecxMsoNormal" align="center" style="text-align:center;"><span style="font-family:"Calibri","sans-serif";">
<hr size="2" width="100%" align="center">
</span></div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">From: <a href="mailto:benjaminrk@gmail.com" target="_blank">
benjaminrk@gmail.com</a><br>
Date: Thu, 8 May 2014 16:03:15 -0700</span></p>
<div>
<div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"><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?</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">On Thu, May 8, 2014 at 11:51 AM, Roman Max. <<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>> wrote:</span></p>
<div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
</div>
</div>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">-MinRK</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;">
<div>
<div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<div class="ecxMsoNormal" align="center" style="text-align:center;"><span style="font-family:"Calibri","sans-serif";">
<hr size="2" width="100%" align="center">
</span></div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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?</span></p>
<div>
<div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">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.</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">-MinRK</span></p>
</div>
</div>
<div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"> </span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">On Thu, May 8, 2014 at 10:11 AM, Roman Max. <<a href="mailto:rmx555@hotmail.com" target="_blank">rmx555@hotmail.com</a>> wrote:</span></p>
<div>
<div>
<p class="ecxMsoNormal" style="line-height:13.5pt;background:white;vertical-align:baseline;">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";">is it possible to pass parameters to IPython notebook via URL?</span></p>
<p class="ecxMsoNormal" style="line-height:13.5pt;background:white;vertical-align:baseline;">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";">How to reference/use those parameters in a notebook?</span></p>
<p class="ecxMsoNormal" style="line-height:13.5pt;background:white;vertical-align:baseline;">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";">e.g. <a href="http://xxxyyzz.org:8888/mynotebook.ipynb" target="_blank"><span style="color:#4A6B82;border:none windowtext 1.0pt;padding:0in;text-decoration:none;">http://xxxyyzz.org:8888/mynotebook.ipynb</span></a><strong><span style="font-family:"Arial","sans-serif";border:none windowtext 1.0pt;padding:0in;">?d1=20140101&d2=20140401</span></strong></span></p>
<p class="ecxMsoNormal" style="line-height:13.5pt;background:white;vertical-align:baseline;">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";"> </span></p>
<p class="ecxMsoNormal" style="line-height:13.5pt;background:white;vertical-align:baseline;">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";">Did not find an answer after searching around. Thanks!</span></p>
</div>
</div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"><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></span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><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></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"><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></span></p>
</blockquote>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><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></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";"><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></span></p>
</blockquote>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
</div>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><br>
_______________________________________________ IPython-dev mailing list <a href="mailto:IPython-dev@scipy.org">
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></span></p>
</div>
</div>
</div>
</div>
</div>
<p style="MARGIN:0in 0in 10pt;" class="ecxMsoNormal"><font face="Calibri">This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to postmaster@tokiomillennium.com and then permanently delete the email and any attachments from your system.</font></p><p style="MARGIN:0in 0in 10pt;" class="ecxMsoNormal"></p><font face="Calibri"> </font><BR><BR><p style="MARGIN:0in 0in 10pt;" class="ecxMsoNormal"><font face="Calibri">E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses.</font></p><p style="MARGIN:0in 0in 10pt;" class="ecxMsoNormal"><font face="Calibri">******************************************</font></p>


<br>_______________________________________________
IPython-dev mailing list
IPython-dev@scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-dev<BR></div></div>                                      </div></body>
</html>