Mono with Python?

Hi there, is there a way to let Python 3.0 call assemblies (or dll files) written in Mono Framework (i.e. C#)? But it must be a crossplatform solution.

If you know something about it let me know.

On the other hand, Blender with IronPython engine comes into my mind… :eyebrowlift2:

There’s one way at least… http://pythonnet.sourceforge.net/readme.html

If you are on Windows, and ctypes doesn’t do the trick:
Think about exposing a COM interface from your C# program and accessing it with comtypes or win32com

On *nix, there are inter-process communications methods like named pipes (FIFOs), that you could access with the standard library, that is if Mono can read/write to them.

(This is all easier said than done, of course.)

I’m pretty sure that IronPython isn’t interchangeable for CPython in the Blender environment. I could be wrong. Let’s say I be really surprised. IronPython might be really useful to write an interface to interact with from Blender. It has most of Python’s standard library, and can use pure python packages just fine. I use IronPython at my job quite a lot to script AutoCAD.

That ‘Python for .NET’ package looks it might be the most pain-free, if you could get it to work. It looks like it only supports CLR version 2.0 (if this is the same as the .NET version, the current version is 4.0). It doesn’t look like it has been ported to Python 3k, also.

There is another way , it will not be as elegant as Python .NET or ctypes but it might be much more stable and more reliable if not easier.

You could run your program divided to different interpreters and then make those interpreters communicate with each other. Sounds complicate but there are libraries that makes this very easy. You could even make Ironpython, Cpython, PyPy and Jython talk to each other.

One such libray is execnet , you can find more info about it in here

http://codespeak.net/execnet/