Python in Visual Studio 2010



    Python is getting closer for those who love and use Visual Studio 2010. Recently, free tools for working with Python code in Visual Studio have been published on the IronPython project site . IronPython is an implementation of the Python 2.6 language created by Microsoft for the .NET platform, the code of which can be used in other .NET languages ​​and, conversely, in IronPython it is possible to call code from .NET projects. The tools that now integrate into the Visual Studio 2010 development environment now offer a complete opportunity to develop projects in Python. And for many .NET developers, these tools will be a great opportunity to learn a new language for themselves in a familiar environment.



    image



    Consider the capabilities of the new tools and how they integrate into Visual Studio.

    Installation


    All you need is the presence of Visual Studio 2010 RTM ( Express is supported ) and the installation of tools from this page . The tool package is small, installation is very fast.

    Projects


    Tools add several new project types to Visual Studio: Console Application, WinForms Application, Silverlight Web Page, and WPF Application.

    image

    Intellisense


    To support code editing, it offers a large number of features, including Intellisense. It supports the ability to complete the names of code elements, help with signatures, quick information when you hover over an element.

    image

    In addition, Intellisense supports both Python built-in functions and .NET classes.

    image

    Code completion also works for importing modules.

    image

    Intellisense is able to distinguish between types in tuple or lists and suggest correct code completion.

    image

    In addition to all, Intellisense has the ability to display signatures of code elements when writing code.

    image

    And finally: Intellisense can tell you what values ​​a variable can take in your code.

    image

    Navigation


    Tools for IronPython integrate into the Visual Studio 2010 navigation bar so that you can quickly navigate Python code.

    image

    Support for the “Go to defenition” function is included, which allows you to quickly jump to the definition of an element in code.

    image

    Support for the “Find All References” function is included, which will allow you to find all the uses of your element in the code.

    image

    Python interpreter interactive window


    These tools add an interactive window with the Python interpreter to Visual Studio 2010, in which you can execute arbitrary code or transfer it for execution from the editor window.

    image

    image

    image

    In addition, Intellisense is supported in an interactive window.

    image

    When editing the code, it can be sent to an interactive window for execution.

    image

    Object Browser


    Tools for IronPython are also integrated into the object browser, which allows you to view all the modules and the elements enclosed in them.

    image

    Debugger


    IronPython tools integrate with the Visual Studio 2010 debugger, allowing you to debug your Python applications in a familiar environment. While debugging for IronPython does not offer the same features as for C #, but the developers promise to make the debugger more sophisticated in future releases.

    image

    image

    Conclusion


    Working with Python for the .NET developer is becoming more interesting and can now happen in the native environment of Visual Studio. The release of such tools should spur developers' interest in the Python language and other dynamic languages. The full functionality of the tools will allow you to integrate Python into .net projects. And that’s great.

    PS: the images for the article are taken from the IronPython For Visual Studio Walkthrough (pdf) document , I recommend that you familiarize yourself with it for a more detailed introduction to the tools.

    Also popular now: