IronPython (2.7.3) コンソールで ac# メソッドを実行しようとしています:
c# (dll にコンパイル) は次のとおりです。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PythonTest
{
public class PythonTest
{
public PythonTest(){}
public int GetOne()
{
return 1;
}
public double Sum(double d1, double d2)
{
return d1+d2;
}
public string HiPlanet()
{
return "Hi Planeta";
}
}
}
パイソンは
import sys
sys.path.append("Y:\\")
import clr
clr.AddReferenceToFile('./PythonTest')
import PythonTest
a = PythonTest.PythonTest.GetOne()
関数が 1 つの引数を取ることを示す Ironpython で TypeError を取得します (これは、私の c# ではありません!)。私は混乱しており、ここで助けを求めています.C#関数を呼び出して引数を提供し、結果を取得しようとしています。事前に感謝します!