ironpython - 如何将选项传递给新的 IronPython 引擎?

标签 ironpython

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

“我的”代码基于 thisthat .

最佳答案

你可以做:

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

并且将启用全帧。所有其他选项都与命令行选项匹配。

关于ironpython - 如何将选项传递给新的 IronPython 引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2304136/

相关文章:

javascript - Spotfire - 使用动态创建按钮

.net - 从Iron Python生成.NET程序集

c# - 如何使用 –X :Frames in Ironpython?

C#/IronPython 与共享 C# 类库的互操作

c# - 在 Iron python 中访问 .Net 枚举

python - 使用 python 或 ironpython 访问 mssql 的最简单方法是什么?

IronPython 和 pdb.set_trace()

python - IronPython 与 Python .NET

python - 使用 pyc 编译 IronPython - 没有名为 numpy 的模块

python - 铁蟒 vs Razor