tags:

views:

88

answers:

1

I am hosting IronPython within IronPython. I did not find the way to initialize it with the equivalent of the command line argument: -X:FullFrames.

My code is somewhat like that:

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())

"my" code is based on this and that.

+4  A: 

You can do:

engine = Python.CreateEngine({'FullFrames': True})

and the full frames will be enabled. All the other options match up w/ the command line options.

Dino Viehland