http://www.xavierdupre.fr/blog/2014-09-20_nojs.html
As a result of this, we put together a package clrmagic that can be installed and loaded into jupyter notebooks:
pip install clrmagic
%reload_ext clrmagic
Here is a small demo:
%%CS mypower System.dll
public static double mypower(double x, double y)
{
if (y == 0) return 1.0;
return System.Math.Pow(x,y);
}
mypower(3.0,3.0)
27.0
Note that clrmagic works and is tested both on Windows (.NET) and Linux (Mono)! It should also work on OSX (Mono), but I have not tested.
Currently the source code is hosted here:
https://github.com/denfromufa/clrmagic
The clrmagic was modeled after fortran magic which uses f2py to extend Python with Fortran.
Regards,
Denis
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/31f2a31c-355c-4396-ba5e-74009758de6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I also noticed this blog post from 2013 by Brian Granger about pythonnet (underlying library for clrmagic) and it is completely invalid anymore. None of this black magic is required anymore.So can I delete it or mark obsolete?
But sometimes using Python and C# in separate kernels is not very convenient.
Currently the source code is hosted here:
Can you provide any example of "graphical output" with any current language cell magics written for IPython kernel?
On Thu, Sep 15, 2016 at 3:20 PM, Denis Akhiyarov <denis.a...@gmail.com> wrote:
Can you provide any example of "graphical output" with any current language cell magics written for IPython kernel?
On Wednesday, September 14, 2016 at 11:07:00 PM UTC-5, Lawrence D’Oliveiro wrote:On Wednesday, September 14, 2016 at 4:40:04 PM UTC+12, Denis Akhiyarov wrote:But sometimes using Python and C# in separate kernels is not very convenient.
It’s a tradeoff: a kernel can maintain context across cells, but a magic makes it easy to mix different languages in a notebook.
Currently the source code is hosted here:Have you thought of adding the option for graphical output? Or even Markdown or HTML output?
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/6ad11b61-4f02-47e0-929a-955dc5ab890e%40googlegroups.com.
Sorry for describing tricks from that wiki article as "black magic", what I really meant is "hacks", which are now taken care of by pythonnet. I know that a lot of people put effort into getting it to work!
--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/Wy7LnDF4O_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAAusYChMFT2eQiG21F8t7Tu%2BxKVrFOpR%2BchMyL4PFvs9CTM4%3Dw%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/Wy7LnDF4O_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAHNn8BW8nDqLwOw%3DBzSYf2Uendaq9Gmo%3D5wwVGwcaABppSZBMQ%40mail.gmail.com.
@Doug, it looks like metakernel-based kernels are full-featured kernels for languages other than CPython.
But clrmagic is just a magic language cell to embed .NET (CLR) languages in CPython/IPython using pythonnet. Metakernel should definitely be helpful to icsharp that I linked before.
On Thu, Sep 15, 2016 at 8:32 AM, Doug Blank <doug....@gmail.com> wrote:--On Thu, Sep 15, 2016 at 9:20 AM, Denis Akhiyarov <denis.a...@gmail.com> wrote:Can you provide any example of "graphical output" with any current language cell magics written for IPython kernel?Depending on how your kernel is written, you might have to use the file system, like matlab or the octave kernels:If your kernel can use the kernel wrapper, you might also want to look at basing your kernel on MetaKernel, to get additional, common magics, shell, etc:-Doug
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/Wy7LnDF4O_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAAusYChMFT2eQiG21F8t7Tu%2BxKVrFOpR%2BchMyL4PFvs9CTM4%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CALxxJLQyg2xDFVGN8v1uZE-XgPDSd-v3OZ8-Z3HYNvPXvoWZeQ%40mail.gmail.com.
On Wednesday, September 14, 2016 at 11:07:00 PM UTC-5, Lawrence D’Oliveiro wrote:
Have you thought of adding the option for graphical output? Or even Markdown or HTML output?
Can you provide any example of "graphical output" with any current language cell magics written for IPython kernel?