How can I call the IronPython function from Python? Is there an easy way for the two to interact. I need the flexibility of both the full set of correct Python libraries not available in IronPython, and the latest version of the CLR, which is currently not available in Python.net.
What I have tried so far is to compile the IronPython DLL, but I cannot get it to load correctly in Python.
My attempt to make IronPython n callable from Python
foo.py
def foo():
print 'hello world'
compile_ipy.py
import clr
clr.CompileModules("foo.dll", "foo.py")
My attempt to call Iron Python from Python
call_ipy_from_py1.py
import ctypes
dll = ctypes.WindDLL('foo.dll')
dll.foo()
call_ipy_from_py2.py
import ctypes
dll = ctypes.cdll.LoadLibrary('foo.dll')
dll.foo()
source
share