0

Name 'false' is not defined when adding "justMyCode": false to launch.json in Visual Studio Code 3

Getting this error when trying to debug my program in python, I'm trying to run with these arguments as shown in the configuration

"configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "main.py",
                "--run_mode",
                "testing",
                "--uni_name",
                "greenwich",
                "--env",
                "local_development"
            ],
        },

not sure what the issue is, here is an answer to a very similar question below,

"This configuration triggers the run or debug of the currently focused file (see the "name": "Python: Current File", and "program": "${file}" settings) And the error message popups, because you tried to debug launch.json file - which makes no sense for a python debugger.

In other words - first, you have to switch to/focus your python file and trigger debug afterward.

but to be honest that answer made no sense to me. I don't get what's being said here {first, you have to switch to/focus your python file and trigger debug afterward} if anyone could help, id be very grateful.

tried running the debugger with the configuration

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "--run_mode",
                "testing",
                "--uni_name",
                "greenwich",
                "--env",
                "local_development"
            ],
        }

get this error

Exception has occurred: NameError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
name 'false' is not defined

matszwecja
  • 6,357
  • 2
  • 10
  • 17
wayne
  • 1
  • 1
  • This is a problem in your Python code, not in your `launch.json` file. Please show your python code. Also, try googling "name error false is no defined". This has already been answered somewhere on the internet. – Code-Apprentice Nov 16 '22 at 15:18

1 Answers1

0

So this has worked,

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "main.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            "args": [
                "--run_mode",
                "testing",
                "--uni_name",
                "greenwich",
                "--env",
                "local_development"
            ]
        }
    ]
}

the value in the program argument needed to be the file in which to launch I assume,

Thank you !
wayne
  • 1
  • 1