[Ironpython-users] Help Change Python Engine Options inside Python

Jeff Hardy jdhardy at gmail.com
Fri Oct 7 17:39:14 CEST 2011


On Fri, Oct 7, 2011 at 6:18 AM, Mark Wilson <mwilsonedu at yahoo.com> wrote:
> Thanks Jeff for the help.
> I do have vs2010. The ipy process is embedded in a commercial software,
> ANSYS.  Do you know how to trigger vs2010 debugging from python  script? The
> console is launched by ANSYS program.

Add the following to your script:

    import System; System.Diagnostics.Debugger.Break()

you may need `import clr` as well if you haven't already done so in that script.

HOWEVER, I had forgotten that this requires ipy.exe to be run with
-X:Debug, so it won't help you much.

Your best bet would be to bug the ANSYS authors to let you set command
line options for IronPython. If ANSYS just launches ipy.exe (as
opposed to embedding the engine), then you could replace their ipy.exe
with one that had the debug options hardcoded on; it's the
IronPythonConsole project in the source tree.

- Jeff


More information about the Ironpython-users mailing list