2

I am trying to debug an IronPython script (my company requires IronPython for some tasks) using Visual Studio Code. The version of IronPython has to be executed using the -X:Frames option.

Here's how I would run the script from the command line:

ipy -X:Frames my_script.py

Adding -X:Frames to the "args" launcher property makes it an argument for the script instead of the interpreter which is incorrect:

ipy my_script.py -X:Frames

Is there a way to pass arguments to the interpreter itself?

If it helps, here's my launch configuration:

"launch": {
    "configurations": [
        {
            "name": "My Tests",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "ipy",
            "program": "C:\\temp\\my_script.py",
            "args": ["-X:Frames"],
            "cwd": "C:\\temp",
            "env": {},
            "envFile": "",
            "debugOptions": [
                "RedirectOutput"
            ]
        }
    ]
},
1
  • 1
    IIRC, when I had to do something similar, there was an open feature request on this, and the workaround was to create a .cmd (Windows) or .sh (macOS/Linux) launcher script and put the path to that as your pythonPath. (And, even better, you had to create slightly different scripts for debugger pythonPath and environment pythonPath…) Hopefully there's a better answer now (or I'm remembering wrong), but if not… that should still work. Commented Jun 18, 2018 at 23:47

1 Answer 1

2

Currently there is no way to pass explicit arguments to the interpreter and not the script itself. See this feature request and please leave a +1 reaction to vote for your desire to see it implemented.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.