如何在Python中调用IronPython函数?是否有一种简单的方法来连接两个?我需要同时拥有完整的Python库和最新的CLR,但Python .net目前没有这些功能。
迄今为止,我尝试编译一个IronPython dll,但无法正确加载它到Python中。
我的尝试是让Python可以调用IronPython。 foo.py
迄今为止,我尝试编译一个IronPython dll,但无法正确加载它到Python中。
我的尝试是让Python可以调用IronPython。 foo.py
def foo():
print 'hello world'
compile_ipy.py
import clr
clr.CompileModules("foo.dll", "foo.py")
我的尝试:从Python调用Iron Python。
call_ipy_from_py1.py
import ctypes
dll = ctypes.WindDLL('foo.dll')
dll.foo() # AttributeError: function 'foo' not found
call_ipy_from_py2.py
import ctypes
dll = ctypes.cdll.LoadLibrary('foo.dll')
dll.foo() # AttributeError: function 'foo' not found