Choose “Python File” as the debug configuration.Press F5 or click on the green “Run and Debug” button.Click on the Debug icon in the Activity Bar on the side of the window.Click on the left margin next to the line number where you want to add a breakpoint (e.g., next to the print statement).Let’s go through the steps for debugging Python within VS Code. Click the “Install” button to add the extension to VS Code.Īfter following these steps, you’ll have the following prerequisites for Python coding:ĭebugging is an inextricable part of the coding process, so you’ll want to have Python’s debugging capabilities ready as soon as you start coding.Find the Python extension by Microsoft on the Marketplace.Search for “Python” in the Extensions view search bar.Click on the “Extensions” icon in the Activity Bar.Here are the further steps for setting the extension up in the IDE: To properly use the Python environment in VS Code, you also have to install the Python extension. Installing the Python Extension in VS Code To learn more about using WSL with VS Code, refer to the VS Code Remote Development documentation or the Working in WSL tutorial. Opting for WSL also involves installing the correlating extension. Anaconda comes with a Python interpreter and a multitude of specialized libraries and tools for data science.įor Windows users who want a Linux environment to work with Python, the Windows Subsystem for Linux (WSL) is another viable option. If data science is your main reason for using Python, consider downloading Anaconda and getting Python through it. You should see the installed Python version on-screen.Type “ python –version” and press “Enter.”.Go to the Downloads page and choose your operating system version (Windows, macOS, or Linux, depending on the library) and click download. You will have to manually set up the Python interpreter on your computer before VS Code can use it.
0 Comments
Leave a Reply. |