4
我在IronPython內託管IronPython。我沒有找到用相當於命令行參數的方式初始化它的方法:-X:FullFrames
。如何將選項傳遞給新的IronPython引擎?
我的代碼是有點像:
import clr
clr.AddReference('IronPython')
clr.AddReference('Microsoft.Scripting')
from IronPython.Hosting import PythonCommandLine, PythonConsoleOptions, Python
clr.AddReference('Microsoft.Dynamic')
clr.AddReference('System')
import System
from Microsoft.Scripting.Hosting.Shell import IConsole
engine = Python.CreateEngine()
runtime = engine.Runtime
for assembly in clr.References:
runtime.LoadAssembly(assembly)
cmdLine = PythonCommandLine()
runtime.Globals.SetVariable('cur_cmdLine',cmdLine)
cmdLine.Run(engine, my_console(), PythonConsoleOptions())