Home > Development Tools > VSCode > body text

A brief discussion on how to use vscode to debug python code on mac

青灯夜游
Release: 2020-12-07 17:32:44
forward
4636 people have browsed it

How to use vscode to debug python code in mac? The following article will introduce to you how to implement vscode debugging python code on mac. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

A brief discussion on how to use vscode to debug python code on mac

Related recommendations: "vscode Basic Tutorial"

Problem: After downloading the python extension, single-point debugging is still not possible Code

Reason: Not configured

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 path in the terminal

which python3
Copy after login

and fill it in as shown below:

A brief discussion on how to use vscode to debug python code on mac

2. Go to lunch.json configuration

As shown in the picture below, click 1 place, then 2 places, and then 3 more places as shown in the add box. To facilitate pasting, add the configuration below:

{
    "name": "Python: currenfile",
    "type": "python",
    "request": "launch",
    "program":"${file}",
    "console":"integratedTerminal"
}
Copy after login

A brief discussion on how to use vscode to debug python code on mac

##3 , At this point, it is completed. Select the currentfile you configured in Figure 2 above, click the ▶️ icon in Figure 2 above to execute, and you can start breakpoint debugging.

For more programming-related knowledge, please visit:

Programming Learning Course! !

The above is the detailed content of A brief discussion on how to use vscode to debug python code on mac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template