Please help me to call an IronPython function passing parameters from
a C# method.

Let's say I have a ScriptEngine and also a ScriptScope. In the scope I
have a Python function like this:

def test(a):
    return a

Then in some C# method I have something like:

string my_a = "A";

How can I call that function passing to it my_a in place of the "a"
parameter? I want to pass the actual object, not just its value, so I
can pass complex objects and manipulate them in IronPython.

Without passing parameters, I can already do this:

var functionCall = string.Format("{0}()", FunctionName);
ScriptSource function =
engine.CreateScriptSourceFromString(functionCall,
SourceCodeKind.Expression);
function.Execute(scope);

Thanks for any help.
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to