{"id":8103,"date":"2020-10-28T11:03:07","date_gmt":"2020-10-28T19:03:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=8103"},"modified":"2020-10-29T10:58:54","modified_gmt":"2020-10-29T18:58:54","slug":"python-in-visual-studio-code-october-2020-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-october-2020-release\/","title":{"rendered":"Python in Visual Studio Code \u2013 October 2020 Release"},"content":{"rendered":"<p>We are pleased to announce that the October 2020 release of the Python Extension for Visual Studio Code is now available. You can <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">download the Python extension<\/a> 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 <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-tutorial\">Python support in Visual Studio Code<\/a> in the documentation.<\/p>\n<p>This was a short release where we addressed 14 issues, and it includes debugpy 1.0!<\/p>\n<p>If you\u2019re interested, you can check the full list of improvements in our <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/blob\/master\/CHANGELOG.md\">changelog<\/a>.<\/p>\n<h2>Debugpy 1.0<\/h2>\n<p>We\u2019re excited to announce that we\u2019re releasing the 1.0 version of our debugger, debugpy, that was <a href=\"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-march-2020-release\/#new-debugger\">first announced<\/a> in March this year.<\/p>\n<p>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 <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/debugging\">on our documentation<\/a>, but check below for some of our favorite ones!<\/p>\n<h2>Debugging Web Apps<\/h2>\n<p>Debugpy supports live reload of web applications, such as Django and Flask<span data-contrast=\"none\"> apps, when debugging.\u00a0<\/span><span data-contrast=\"none\">This means that when you make edits to your application, you don\u2019t need to restart the debugger to get them applied<\/span><span data-contrast=\"none\">: the web server is autom<\/span><span data-contrast=\"none\">atically reloaded in th<\/span><span data-contrast=\"none\">e<\/span><span data-contrast=\"none\">\u00a0same debugging session once the changes are saved.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\" data-wac-het=\"1\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">To try it out, open a web application and add a debug configuration\u00a0(by\u00a0clicking on\u00a0<strong>Run &gt; Add Configuration\u2026<\/strong>, or by opening the Run view and clicking on\u00a0<strong>create launch.json file<\/strong>).\u00a0\u00a0Then select the framework used in your web application<\/span><span data-contrast=\"none\"> &#8211; in this example, we selected\u00a0<\/span><span data-contrast=\"none\">Flask.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\" data-wac-het=\"1\">\u00a0<\/span><\/p>\n<p>Now you hit F5 to start debugging, and then just watch the application reload once you make a change and save it!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-LiveReload.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8104\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-LiveReload.gif\" alt=\"Live reload of Flask application when debugging\" width=\"1828\" height=\"1046\" \/><\/a><\/p>\n<p>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:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-Templates.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-8105 size-full\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-Templates.gif\" alt=\"Execution stopping on breakpoint in a template file\" width=\"1772\" height=\"1144\" \/><\/a><\/p>\n<h2>Debugging local processes<\/h2>\n<p>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 &#8220;Attach using Process Id&#8221; configuration in the launch.json file:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-AddConfigToAttach.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-8106 size-full\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-AddConfigToAttach.gif\" alt=\"Adding configuration for the debugger to attach to a local process\" width=\"2210\" height=\"1368\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-AttachingToLocalProcess.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-8107 size-full\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-AttachingToLocalProcess.gif\" alt=\"Attaching the debugger to a process running locally\" width=\"2210\" height=\"1368\" \/><\/a><\/p>\n<h2>Debugging remotely<\/h2>\n<h3>Remote Development Extensions<\/h3>\n<p>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\u00a0in the remote environment, while providing the same development experience as you get when developing locally:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-Containers.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-8108 size-full\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-Containers.gif\" alt=\"Running the debugger inside a docker container\" width=\"1772\" height=\"1144\" \/><\/a><\/p>\n<p>This way, you can use the same configurations for debugpy as you would locally &#8211; but it will actually be installed and executed in the remote scope. No more messing around with your local environment!<\/p>\n<p>You can learn more about the VS Code Remote Development extensions on <a href=\"https:\/\/aka.ms\/vscode-remote\">the documentation<\/a>.<\/p>\n<h3>Remote attach<\/h3>\n<p>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:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach.png\"><img decoding=\"async\" class=\"aligncenter wp-image-8109 size-full\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach.png\" alt=\"Configuration for attaching the debugger to a remote machine\" width=\"1785\" height=\"1154\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach.png 1785w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach-300x194.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach-1024x662.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach-768x497.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2020\/10\/October2020-RemoteAttach-1536x993.png 1536w\" sizes=\"(max-width: 1785px) 100vw, 1785px\" \/><\/a><\/p>\n<p>You can learn more about <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/debugging#_remote-script-debugging-with-ssh\">remote debugging<\/a> in the documentation.<\/p>\n<h2>Other changes and enhancements<\/h2>\n<p>We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. Some notable changes include:<\/p>\n<ul>\n<li>Fix exporting from the interactive window. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/14210\">#14210<\/a>)<\/li>\n<li>Do not opt users out of the insiders program if they have a stable version installed. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/14090\">#14090<\/a>)<\/li>\n<\/ul>\n<p>We\u2019re constantly A\/B testing new features. If you see something different that was not announced by the team, you may be part of the experiment! To see if you are part of an experiment, you can check the first lines in the Python extension output channel. If you wish to opt-out of A\/B testing, you can open the user settings.json file (<strong>View <\/strong>&gt; <strong>Command Palette&#8230;<\/strong> and run <strong>Preferences: Open Settings (JSON)<\/strong>) and set the &#8220;<em>python.experiments.enabled<\/em>&#8221; setting to <em>false<\/em>.<\/p>\n<p>Be sure to <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">download the Python extension<\/a> for Visual Studio Code now to try out the above improvements. If you run into any problems or have suggestions, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/new\/choose\">please file an issue<\/a> on the <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub<\/a> page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The October 2020 release of the Python Extension for Visual Studio Code is now available. This was a short release where we addressed 14 issues, and it includes debugpy 1.0! Keep on reading to learn more.<\/p>\n","protected":false},"author":1064,"featured_media":8105,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,6],"tags":[],"class_list":["post-8103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>The October 2020 release of the Python Extension for Visual Studio Code is now available. This was a short release where we addressed 14 issues, and it includes debugpy 1.0! Keep on reading to learn more.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/users\/1064"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=8103"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8103\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/8105"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=8103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=8103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=8103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}