We are pleased to announce that the October 2020 release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can learn more about Python support in Visual Studio Code in the documentation.

This was a short release where we addressed 14 issues, and it includes debugpy 1.0!

If you’re interested, you can check the full list of improvements in our changelog.

Debugpy 1.0

We’re excited to announce that we’re releasing the 1.0 version of our debugger, debugpy, that was first announced in March this year.

Debugpy offers a great number of features that can help you understand bugs, errors and unexpected behaviors in your code. You can find an extensive list on our documentation, but check below for some of our favorite ones!

Debugging Web Apps

Debugpy supports live reload of web applications, such as Django and Flask apps, when debugging. This means that when you make edits to your application, you don’t need to restart the debugger to get them applied: the web server is automatically reloaded in the same debugging session once the changes are saved.

To try it out, open a web application and add a debug configuration (by clicking on Run > Add Configuration…, or by opening the Run view and clicking on create launch.json file).  Then select the framework used in your web application – in this example, we selected Flask.

Now you hit F5 to start debugging, and then just watch the application reload once you make a change and save it!

You can also debug Django and Flask HTML templates. Just set up breakpoints to the relevant lines in the HTML files and watch the magic happen:

Debugging local processes

With the debugpy and the Python extension, you can get a list of processes running locally, and easily select one to attach debugpy to. Or, if you know the process ID, you can also add it directly to the “Attach using Process Id” configuration in the launch.json file:

Debugging remotely

Remote Development Extensions

You can use debugpy to debug your applications inside remote environments like Docker containers or remote machines (or even in WSL!) through the Remote Development extension. It allows VS Code to work seamlessly by running a light-weight server in the remote environment, while providing the same development experience as you get when developing locally:

This way, you can use the same configurations for debugpy as you would locally – but it will actually be installed and executed in the remote scope. No more messing around with your local environment!

You can learn more about the VS Code Remote Development extensions on the documentation.

Remote attach

You can also configure the debugger to attach to a debugpy server running on a remote machine. All you need to provide is the host name and the port number the debugpy server is listening to in the remote environment:

Configuration for attaching the debugger to a remote machine

You can learn more about remote debugging in the documentation.

#python #visual studio code

Python in Visual Studio Code – October 2020 Release
1.35 GEEK