I have the python code, which is saved into test.py
def Process():
list1 = [1, 2, 3] #list object
return list1
I also have C# code
List<int> list1 = new List<int>(new int[3]);
var runtime = Python.CreateRuntime();
dynamic test = runtime.UseFile(m_sFilename);
var list2 = test.Process();
list1 = (List<int>)list2; << Error
/*
list1[0] = list2[0]; // this code works fine but need how to
list1[1] = list2[1];
list1[2] = list2[2];
*/
When I run this I get RuntimeBinderException was unhandled
Cannot convert type 'IronPython.Runtime.List' to 'System.Collections.Generic.List'
How to fix this?
Also how to pass the list into the Python?