skip to navigation
skip to content

clrmagic 0.0.1a2

IPython cell magic to use .NET languages

IPython cell magic to use .NET languages (C#, VB.NET, F#) from jupyter notebooks:

https://pypi.python.org/pypi/clrmagic/

Based on a blog post from Xavier Dupré @sdpython:

http://www.xavierdupre.fr/blog/2014-09-20_nojs.html

Simple wheel installation:

pip install clrmagic

Launch Jupyter notebook with IPython kernel:

jupyter notebook

In open notebook load clrmagic extension:

%reload_ext clrmagic

Magic cell with C# code:

%%CS mypower System.dll
public static double mypower(double x, double y)
{
  if (y == 0) return 1.0 ;
  return System.Math.Pow(x,y) ;
}
<function clrmagic.create_cs_function.<locals>.<lambda>>

Next evaluate in normal IPython cell:

mypower(3.0,3.0)
27.0
 
File Type Py Version Uploaded on Size
clrmagic-0.0.1a2-py2.py3-none-any.whl (md5) Python Wheel any 2016-09-15 5KB
clrmagic-0.0.1a2.tar.gz (md5) Source 2016-09-13 3KB