Home > Mobile >  Whilst trying to use the VScode debugger, it opens for 2 seconds, closes, and I don't receive a
Whilst trying to use the VScode debugger, it opens for 2 seconds, closes, and I don't receive a

Time:01-01

I am trying to debug a python file that I have in my VScode and whenever I press the play button for "Python: Current" I get a message in the terminal like this and I don't receive an error message. I am using macOS

brianw@BLT-3 VScode % cd "/Users/brianw/Desktop/Coding Projects/VScode" ; /usr/bin/env /usr/local/bin/python3 /Users/brianw/wpilib/2022/vscode/code-portable-data/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 51951 -- "/Users/brianw/Desktop/Coding Projects/VScode/Python-Code-Challanges/debugg.py"

I have looked almost everywhere on the internet and couldn't find a solution for over an hour. I tried to ask the chatGDP bot and it was no help, I did everything it said to troubleshoot, but nothing worked. I tried looking it up, but I got a troubleshooting problem that I couldn't fix, "Make sure that you have the correct Python interpreter selected in the VSCode settings. You can do this by going to the bottom left corner of the VSCode window, clicking on the Python icon, and selecting the interpreter you want to use." and then "In the search bar at the top of the Settings window, type "python.pythonPath" and press enter." but I searched it and nothing popped up.

Edit: The problem was the data was in a funtion and I didn't call the funtion

CodePudding user response:

Steps to debug python code in vscode:

  1. Go to the run and debug option in the side bar.
  2. Click your current python file for debugging.

But the important step is to place a breakpoint in your program before starting to debug your code..

If you didn't place any breakpoints it will close automatically.

  • Related