示例#1
0
文件: Misc.cs 项目: sheyfzh/envision
 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);
 }
示例#2
0
 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;
 }
示例#3
0
        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);
        }