我在 CPython 中使用 pythonnet,我设法安装它
import clr
clr.AddReference('Assembly')
确实有效。
在我的 C# 代码中,如果成员
public void Action(double Freq, double ChannelSpace, bool RefDoubler, bool RefD2, double RCounter, int DeviceIndex)
{... //something is done
}
如果我现在尝试做(在 Python 中):
from Assembly import Class
from System import Double, Int32,Boolean
Class.Action(Double(3000), Double(10), Boolean(False), Boolean(False), Double(10), Int32(0))
它总是抱怨并说:
TypeError: No method matches given arguments
为什么?