This question gives a nice overview of how to call a python function from C# using IronPython.
If our python source looks like:
def get_x():
return 1
The basic approach is:
var script = @"
def get_x():
return 1";
var engine = Python.CreateEngine();
dynamic scope = engine.CreateScope();
engine.Execute(script, scope);
var x = scope.get_x();
Console.WriteLine("x is {0}", x);
But what if our python source is:
def get_xyz():
return 1, 2, 3
What is the C# syntax for handling multiple return values?