Hi Curt,

thanks for your answer. It's an interesting idea, to hand over the items as function arguments. I was trying to add them to the ScriptScope.

But I'm still stuck with calling the function:

ScriptScope scope =
  ScriptRuntime.Create().GetEngine("py").CreateScope();
scope.Execute("from math import *");
scope.Execute(@"
def process(a, b, c):
  return [a+b, sqrt(b*c)]
");
object process = scope.GetVariable("process");
foreach(object[] row in data)
  object[] result = process(row); // ??

How do I call the function?

I have some further question regarding this approach:

1. Will the function be interpreted on each call or is it compiled?
2. Is the number of arguments limited? I could have up to 200 arguments.

Meanwhile I've tried the CustomSymbolDictionary way, but couldn't find any helpful tutorial.

Thanks for your time,
Christian
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to