私のアプリケーションC#3.5でironpython 2.6.2の実装を使用していますが、次のエラーが表示されます。「メソッドまたは操作が実装されていません。 DLRとIronPythonのアセンブリへError IronPython + C#3.5
を追加しまし参照(すべて「C:\プログラムファイル\ IronPythonの2.6」であるIronPythonのインストールディレクトリ、で見つかった私のマシン上):
IronPython.dll
IronPython.Modules.dll
Microsoft.Scripting.dll
Microsoft.Scripting.Core.dll
が私のコードを次のアプリケーション:
ScriptEngine engine = Python.CreateEngine();
//parameter file path
ScriptSource source = engine.CreateScriptSourceFromFile(pathFilePy);
ScriptScope scope = engine.CreateScope();
ObjectOperations op = engine.Operations;
source.Execute(scope); // class object
object classObject = scope.GetVariable("calc"); // get class object
object instance = op.Invoke(classObject); // create instance
object method = op.GetMember(instance, "calc01"); // get method
var result = op.Invoke(method, 10, 20,30); // call method and get result
コードファイルの.py
class calc(object):
def calc01(self,var1,var2,var3):
bla = ((var1+var2+var3)/3)
return bla
エラーが発生このライン上のS:
var result = op.Invoke(method, 10, 20,30); // call method and get result
ここでエラーが発生しますか。どの行? –
var result = op.Invoke(メソッド、10、20,30); //メソッドを呼び出して結果を得る – user1237699