Skip to main content

IPython cell magic to use .NET languages

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for clrmagic, version 0.0.1a2
Filename, size File type Python version Upload date Hashes
Filename, size clrmagic-0.0.1a2-py2.py3-none-any.whl (5.7 kB) File type Wheel Python version any Upload date Hashes View hashes
Filename, size clrmagic-0.0.1a2.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page