News

Python in Visual Studio Code Update Adds Debugger, Debugpy 1.0

The new Debugpy debugger for Python in Visual Studio Code hits version 1.0 in the latest update of the Python tooling for the open source, cross-platform code editor.

Python for VS Code comes with the Python extension in the editor's marketplace, which has been installed a whopping 26.6 million times, making the most popular tool in the marketplace by far.

Microsoft updates the VS Code Python tooling regularly, and in March announced Debugpy, which just hit version 1.0 status, according to an Oct. 28 blog post.

Debugpy offers a great number of features that can help you understand bugs, errors and unexpected behaviors in your code," said Luciana de Melo e Abud, program manager. "You can find an extensive list on our documentation, but check below for some of our favorite ones!" (Note that the documentation link wasn't working for this reporter at press time.)

The post goes on to describe three ways of debugging:

  • Debug web apps: The tool supports live reload of web applications, Django and Flask apps, for examples. So when edits are made to an application, a restart of the debugger isn't required to apply them, because the web server is automatically reloaded in the same debugging session upon changes being saved.
    Live Reload in Animated Action
    [Click on image for larger, animated GIF view.] Live Reload in Animated Action (source: Microsoft).
  • Debug local processes: Developers can choose to attach debugpy to one of a list of local process that can be displayed. If a process ID is already known, it can be added directly to the "Attach using Process Id" configuration in the launch.json file.
  • Debug remotely: This can be done in two ways:
    • 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."
    • 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."
  • The post also lists a couple of notable changes:

    • Fix exporting from the interactive window. (#14210)
    • Do not opt users out of the insiders program if they have a stable version installed. (#14090)

    About the Author

    David Ramel is an editor and writer for Converge360.

    comments powered by Disqus

    Featured

    • Full Stack Hands-On Development with .NET

      In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

    • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

      "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

    • Creating Reactive Applications in .NET

      In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

    • AI for GitHub Collaboration? Maybe Not So Much

      No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

    • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

      As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

    Subscribe on YouTube