![](/img/trans.png)
[英]Problems embedding IronPython in C# (Missing Compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember'
[英]IronPython init() being called by C# Operations.InvokeMember?
因此,基本上,我已经创建了一个Python对象,并且想要调用其函数之一,如下所示。
public static dynamic ExecuteClassFunction(string filePath, OldInstance pythonObject, string functionName, dynamic[] arguments)
{
s_ScriptScope = s_PythonEngine.ExecuteFile(filePath);
return s_PythonEngine.Operations.InvokeMember(pythonObject, functionName, arguments);
}
但是,我收到错误信息“ init()恰好接受1个参数(给定3个)”。 为什么即使我之前已经初始化了对象,它也为什么调用init()?
没关系,我发现我在其他地方调用了一个构造函数,并在不需要的时候将值传递给它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.