未加星标

Python in Visual Studio Code October 2018 Release

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二03 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏

We are pleased to announce that the October 2018 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. You can learn more about Python support in Visual Studio Code in the documentation.

In this release we have closed a total of 49 issues, including:

Jupyter support: import notebooks and run code cells in a Python Interactive window Use new virtual environments without having to restart Visual Studio Code Code completions in the debug console window Improved completions in language server, including recognition of namedtuple, and generic types

Keep on reading to learn more!

Jupyter Support with the Python Interactive window

The extension now contains new editor-centric interactive programming capabilities built on top of Jupyter. To get started, make sure to have Jupyter installed in your environment (e.g. set your environment to Anaconda) and type #%% into a Python file to define a Cell. You will notice a “Run Cell” code lens will appear above the #%% line:


Python in Visual Studio Code   October 2018 Release

Clicking Run Cell will open the Python Interactive window to the right and run your code. You can define further cells or press Shift+Enter to run the current cell and automatically create a new one (or advance to the next cell).

Separately, if you were to open a Jupyter Notebook file (.ipynb), you will now be prompted to import the notebook as Python code:


Python in Visual Studio Code   October 2018 Release

Cells in the Jupyter Notebook will be converted to cells in a Python file by adding #%% lines. You can run the cells to view the notebook output in Visual Studio code, including plots:


Python in Visual Studio Code   October 2018 Release

Check out our blog post Data Science with Python in Visual Studio Code for a deep dive of the new capabilities!

Completions in the Debug Console

When stopped at a breakpoint and typing expressions into the debug console, you now get completions appearing:


Python in Visual Studio Code   October 2018 Release

Completions are based on variables available at runtime in the current scope.

Automatic detection of new virtual environments

The Python extension will now detect new virtual environments that are created in your workspace root while Visual Studio Code is running. You can create virtual environments from the terminal, and they are immediately available to select by clicking on the interpreter selector in the status bar, or by using the Python: Select Interpreter command.


Python in Visual Studio Code   October 2018 Release

In the screenshot above a new virtual environment named “env” was created in the terminal, and then set the active environment, as indicated by 'env' in the status bar. Previously you had to reload Visual Studio Code for the new environment to be available.

Other Changes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. The full list of improvements is listed in our changelog ; some notable changes include:

Add bandit to supported linters. (thanks Steven Demurjian Jr. ) ( #2775 ) Added a debugger setting to show return values of functions while stepping. ( #2463 ) Language server completion support for namedtuple , typing.NewType , typing.TypeVar , and generic containers. Add debugger support for pyside2 . ( #3235 )

Be sure to download the Python extension for Visual Studio Code now to try out the above improvements. If you run into any problems, please file an issue on the Python VS Code GitHub page.

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

代码区博客精选文章
分页:12
转载请注明
本文标题:Python in Visual Studio Code October 2018 Release
本站链接:https://www.codesec.net/view/611593.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(80)