[Python] How do I stop VS code from running a python file with a debugger?

Discussão em 'Python' iniciado por Stack, Setembro 9, 2025.

  1. Stack

    Stack Membro Participativo

    My general problem is that when I run code after updating the python version, the printed messages now appear to be printed diagonally, and pressing the up arrow to pull up the previous line causes a flood of error messages that can only be corrected by killing the terminal. To my understanding, this is because python is entering REPL mode (for whatever reason). If I run exit(), it is fixed, but I don't want to run exit() everytime I run the script, because I forget, press the wrong key, and then have to kill the terminal and lose my printed messages.

    One reason I've found for why it's now running in REPL mode is because its running with debugging. I've already tried running without the debugger the usual way, via control+f5 (I'm on a mac), remapped the shortcut to be sure I was triggering it, and ran the python file by going to menu Run -> Run without debugging. I also tried altering the launch file with the following code, but all my efforts still result in the python file running with a debugger.

    I can't seem to change the type to python, because VS code warns me that "This configuration will be deprecated soon. Please replace 'python' with 'debugpy' to use the new Python Debugger extension."

    {
    "version": "0.2.0",
    "configurations": [

    {
    "name": "Run DashSite3 Python file",
    "type": "debugpy",
    "request": "launch",
    "program": "${workspaceFolder}/dashsite3.py",
    "console": "integratedTerminal",
    "justMyCode": true,
    "stopOnEntry": false,
    "internalConsoleOptions": "neverOpen",
    "noDebug": true
    }
    ]
    }


    Here are the terminal messages that appear when I try the previously stated methods: ` (.venv) (base) office@wc129-dhcp-33 FinishedDashMetering-main % python -u dashsite3.py

    Dash is running on http://localhost:8087/

    • Serving Flask app 'dashsite3'
    • Debug mode: on Python 3.13.5 | packaged by Anaconda, Inc. | (main, Jun 12 2025, 11:23:37) [Clang 14.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information.

    [12:45:50] Callback triggered for power table GGG update_trees_graph triggered [Info] df_avg not ready yet, returning 0 [12:45:50] [update_current_graph] Callback triggered for current table [update_current_graph] Window width received: 1512 (type: <class 'int'>) CHIMICHUNGAS TRUE [DEBUG] Columns in df:Daily Average POW EmptyDaily Average POW Empty ['TIME', 'BOARDNUM', 'POWER']
    ​

    [INFO] No new power data — showing last valid figure.
    CHICKEN1 None
    CHICKEN5 None

    Columns: [TIME, BOARDNUM, POWER]
    Index: []
    Empty DataFrame
    Columns: [TIME, BOARDNUM, POWER]`

    (more diagonal print lines)


    >>> exit()

    (now regularly stacked print lines)


    \[12:46:01\] \[update_current_graph\] Callback triggered for current table \[update_current_graph\] Window width received: 1512 (type: \<class 'int'\>) CHICKEN1 None CHICKEN5 None \[update_current_graph\] Daily Avg Current empty, returning latest_curry_sum = 0 \[update_current_graph\] Latest Total Current: None ^C% (.venv) (base) office@wc129-dhcp-33 FinishedDashMetering-main % \

    Continue reading...

Compartilhe esta Página