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