BT

Package Management for Python Tools for Visual Studio

| by Jonathan Allen Follow 576 Followers on Apr 02, 2015. Estimated reading time: 2 minutes |

Microsoft is continuing its efforts to support Python in Visual Studio. Still in beta, Python Tools for Visual Studio 2.2 (PTVS) brings more of the standard features found in other VS supported languages such as C# and VB.

First on the list is Task Comments. This is a surprising one because on the surface the functionality seems so simple. All it does is scan for comments that begin with certain keywords (TODO and HACK by default) and adds them to the integrated task list.

Next up is the ability to collapse code, also known as “outlining”. Steve Dower writes,

This has probably been our most popular request ever, and so we've added it. Now you can collapse almost anything that spans multiple lines, no matter where they are in your code. This includes functions, classes, lists, dictionaries, loops, exception handlers, and even multi-line strings.

He goes on to say that Python will also support regions. Since # is already a comment character in Python, Visual Studio can honor lines that begin with #region without actually changing the language.

This brings up one of the limitations that the Visual Studio developers face. Languages that were created for .NET such as VB, C#, and F# were also created specifically to allow for good IDE experiences. And if the IDE needs something, the language can often be changed to accommodate it. But changing Python, with using comment tricks, is simply not feasible. Not only would Microsoft need to request a change to the standard, they would have to wait until most or all of the various implementations of Python catch up.

Something that Microsoft can offer is code snippets. These work the same way in Python as they do in C# and VB. New snippets can be added by developers as usual and optionally submitted to Microsoft to be included in future versions of PTVS.

Package Management

The Environments window in Visual Studio has received a face lift. Besides making it easier to see which environments are installed and access their interactive windows, it now supports package management. The Python equivalent to NuGet is the Python Package Index, which you can now search directly from Visual Studio.

Debugging

In the realm of debugging, PTVS is starting to catch up. Breakpoints now support counters, which are useful when debugging loops or spot-checking frequently called functions.

The Autos window is also supported now. For non-VS users, Autos is basically a watch window that is automatically updated based on the last line that was executed. Generally speaking, it will display local variables and expressions near the current line indicator.

Python Tools for Visual Studio is available for VS 2013 and VS 2015 CTP 6.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT