Calling IronPython object from C# with mono
问题 I have the following IronPython code. class Hello: def __init__(self): pass def add(self, x, y): return (x+y) I need to call this from C#, and I came up with the following code. using System; using IronPython.Hosting; using IronPython.Runtime; using IronPython; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; class Hello { public static void Main() { ScriptEngine engine = Python.CreateEngine(); ScriptSource script = engine.CreateScriptFromSourceFile("myPythonScript.py");