如何从Python2.7加载C#dll
我有一个c#项目,所以我想用python 2.7调用该dll。 我遵循了[Call the C#Methods from Python example][1],得到了以下错误如何从Python2.7加载C#dll,c#,python-2.7,dll,C#,Python 2.7,Dll,我有一个c#项目,所以我想用python 2.7调用该dll。 我遵循了[Call the C#Methods from Python example][1],得到了以下错误 DynamicCalc Traceback (most recent call last): File "client.py", line 20, in <module> print calc.add(a, b) AttributeError: 'DynamicCalc' object has no
DynamicCalc
Traceback (most recent call last):
File "client.py", line 20, in <module>
print calc.add(a, b)
AttributeError: 'DynamicCalc' object has no attribute 'add'
[1]: https://www.red-gate.com/simple-talk/dotnet/net-framework/dynamic-language-integration-in-a-c-world/
DynamicCalc
回溯(最近一次呼叫最后一次):
文件“client.py”,第20行,在
打印计算添加(a、b)
AttributeError:“DynamicCalc”对象没有属性“add”
[1]: https://www.red-gate.com/simple-talk/dotnet/net-framework/dynamic-language-integration-in-a-c-world/
该链接解释了如何从运行在IronPython()中的python代码调用C#方法。它不能与“传统”的python 2.7解释器一起使用。不过,有一些替代方法:(但我没有尝试过)该链接解释了如何从运行在IronPython()中的python代码调用C#方法。它不能与“传统”的python 2.7解释器一起工作。不过,还有其他选择:(但我还没有尝试过)