hello, I have a C# program which executes a python scrip
How can I retrieve the python returning value in my C# program ?
thanks!
hello, I have a C# program which executes a python scrip
How can I retrieve the python returning value in my C# program ?
thanks!
As far as I know, you should use ScriptScope object which you create from the ScriptEngine object using CreateScope method
ScriptEngine engine = ScriptRuntime.Create().GetEngine("py");
ScriptScope scope = engine.CreateScope();
Then you can share variables between the C# program and the python script by doing this
scope.SetVariable("x", x);
if your using System.Diagnostics.Process to launch your python script, then you can get the return code after process exit
using
process.ExitCode