コード例 #1
0
    static void SetPyEnv(ScriptRuntime runtime, string pyscript, string[] args)
    {
        ScriptScope scope = Python.ImportModule(runtime, "sys");

        scope.SetVariable("version", "ironpython");

        IronPython.Runtime.List lst =
            (IronPython.Runtime.List)scope.GetVariable("argv");

        lst.Clear();
        lst.append(pyscript);
        foreach (string arg in args)
        {
            lst.append(arg);
        }
    }