Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从Python2.7加载C#dll_C#_Python 2.7_Dll - Fatal编程技术网

如何从Python2.7加载C#dll

如何从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

我有一个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 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解释器一起工作。不过,还有其他选择:(但我还没有尝试过)