public static IronPython.Runtime.List ComplexArray_to_List(ComplexF[] complex_array) { IronPython.Runtime.List l = new IronPython.Runtime.List(); System.Threading.Tasks.Parallel.ForEach(complex_array, item => { l.append(new System.Numerics.Complex(item.Re, item.Im)); }); return(l); }
internal static IronPython.Runtime.List ComplexArray_to_List(ComplexF[] complex_array) { IronPython.Runtime.List l = new IronPython.Runtime.List(); foreach (var item in complex_array) { l.append(new System.Numerics.Complex(item.Re,item.Im)); } return l; }
private void SetupArguments(ref ScriptRuntime runtime) { // setup arguments (sets sys.argv) // engine.Setup.Options["Arguments"] = arguments; // engine.Runtime.Setup.HostArguments = new List<object>(arguments); var sysmodule = Engine.GetSysModule(); var pythonArgv = new IronPython.Runtime.List(); // for python make sure the first argument is the script pythonArgv.append(runtime.ScriptSourceFile); pythonArgv.extend(runtime.ScriptRuntimeConfigs.Arguments); sysmodule.SetVariable("argv", pythonArgv); }