我在IronPython中托管IronPython。我没有找到用命令行参数的等效值初始化它的方法:
-X:FullFrames
.
我的代码有点像:
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())
“我的”代码基于
this
和
that
.