I have a Python script which I use in my C# code (Ironpython), which works fine. So additionally I'd like to add a list as input parameter for my function in the Python script.
I get some strings from a C# WinForm which I have formatted like Python code:
string code = "list [a, b, c, d]";
My additional C# Code:
ScriptSource source = m_engine.CreateScriptSourceFromString(code);
dynamic script = m_engine.ExecuteFile(@"path to my file");
dynamic function = script.UpdateElements(source);
But then I get the following exception:
iteration over non-sequence of type ScriptSource
In my Python file I have a function like this (where source is a list):
def UpdateElements(source):
#do some stuff
So my question: how can I pass a list of strings from C# as input to my function in the Python script?
for s in source:...