How to use vscode to debug python code under mac
This article is about how to use vscode to debug python code under mac. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
Problem: after downloading the python extension, you still cannot debug the code at a single point
Reason: no configuration
The configuration is as follows:
1. Open the settings of vscode, search for python.pythonPath, and configure python according to the path. You can enter your own according to the path in the terminal.
Which python3
Fill in the following figure:
2. Go to lunch.json configuration
Click 1 in the following figure, then click 2, and then add as shown in the box in 3. For ease of pasting, add the configuration below:
{"name": "Python: currenfile", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal"}
3. At this point, complete, select your configured currentfile in figure 2 above, click the ▶️ icon in figure 2 above to execute, and you can debug the breakpoint.
Thank you for reading! On how to use vscode to debug python code under mac is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.