I'm writing a C# GUI application where I'd like to use numpy, which I have used under Python 2.7 extensively and which is very fast and easy to program. (I still find the GUI work in C# much easier to use than PyQt.)
An IronPython port of numpy and scipy exists now and I'd like to learn how to use it.
Before starting, I'd like to know what kind of deployment options I will have? Can I fully wrap python and numpy or do I have to install python, Ironpython, numpy on my customer's machines?
You can wrap Ironpython code to a .net assembly as a DLL or exe. If you need to load the code from other .NET code, create a DLL using an IronPython script
import clr
clr.CompileModules(dllname, module1.py, module2.py,...)
then load that assembly with
Assembly dpma = Assembly.LoadFile(Path.GetFullPath("CompiledIronPythonModule.dll"));
pyEngine.Runtime.LoadAssembly(dpma);
(C# example). In VisualStudio you will need references to IronPython and the dll in the project.
I just succeeded in compiling numpy and scipy-refactored from scratch with IronPython 2.7.5, Visual Studio 2012 .NET 4.0 with Intel Fortran Composer XE 2013 (using the latter needed some changes to the scipy iron_setup.py files). The output are a set of DLLs. I can at this point import the modules on the IronPython command line. What's not working yet is how to cook IronPython code with a numpy/scipy import into a .net assembly. For this, I will be checking into ironpycompiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With