[IronPython] C# replacement wrapper for ipy.exe

Doug Blank doug.blank at gmail.com
Tue Mar 22 20:06:30 CET 2011

I'm using the following C# code as a replacement for "ipy.exe
myscript.py". One reason for doing this is that this can be run in the
background on Unix/Mac OSX under Mono, whereas ipy.exe can not. I
don't know if there are other reasons, or if there are speed

However, my FullFrames isn't working under IronPython 2.6 beta 2. Some

1) Is this a good replacement for ipy.exe? Anything that I should do
different or add? Any other -X flags I should consider?

2) Does FullFrames work under IronPython 2.6 beta 2 under Mono? If so,
is there something I am doing wrong?

Thanks for any ideas,


using System;
using IronPython.Hosting;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using System.Diagnostics;

public class MyProject {
  static void Main(string[] args) {
        ScriptRuntimeSetup scriptRuntimeSetup = new ScriptRuntimeSetup();
        LanguageSetup language = Python.CreateLanguageSetup(null);
        language.Options["FullFrames"] = true;
        ScriptRuntime runtime = new
        ScriptScope scope = runtime.CreateScope();
        ScriptEngine engine = runtime.GetEngine("python");
        ScriptSource source = engine.CreateScriptSourceFromFile("myscript.py");
        try {
        } catch (IronPython.Runtime.Exceptions.SystemExitException e) {
          // exit

More information about the Ironpython-users mailing list