Python Tools in Visual Studio (PTVS) is an extremely powerful tool because of the following reasons:
In this chapter, we will have a high-level overview of PTVS, starting with a step-by-step tutorial for installing and configuring it correctly followed by a quick overview of the principle tools of Visual Studio to control the Python environment and configuration. Understanding the Visual Studio windows will greatly benefit your ability to explore and manage workflows of the source code and the structure of your Python project.
There are various formats of PTVS available for installation depending on your preexisting installed version of Visual Studio. PTVS is available for Visual Studio 2010, 2012, and 2013 (Pro edition or above).
If the previously mentioned versions of Visual Studio are not installed on your computer, it's possible to install a standalone version of PTVS. Visual Studio permits side-by-side installation, meaning it provides the ability to install multiple versions on one system. The only prerequisite is that the older version must be installed before the newer one.
The different types of installations possible for PTVS are described on its CodePlex website, http://go.microsoft.com/fwlink/?LinkID=390659.
The preceding figure is taken from http://go.microsoft.com/fwlink/?LinkID=390659.
The most important prerequisite for Visual Studio 2013 is to have Windows 7 (32 or 64 bit) or above running as your operating system.
Once you have sorted out the prerequisites and installed the PTVS package of your choice, you will need to decide on the type of Python interpreter. Choosing the appropriate Python interpreter depends on your need for your project. Refer to the PTVS CodePlex page at http://go.microsoft.com/fwlink/?LinkID=299429 to help your decision-making process. You can choose between CPython and IronPython (32 or 64 bit). If you chose CPython, then you can choose between Python Version 2.7 and 3.3. It is recommended to use CPython 3.3 32 bit for most cases. For web development, the recommendation would be CPython 2.7 32 bit.
Make your choice based on what you intend to do and the framework that you will be using with Python. For the scope of this book, we suggest to install the 32-bit CPython Version 2.7. For the latest complete list of downloadable Python interpreters, please refer to the PTVS CodePlex page at http://go.microsoft.com/fwlink/?LinkID=390659.
Once the interpreter is installed, you can fire up PTVS by opening the Visual Studio 2013 application from the Start menu. If everything works, this is what you are going to see on your screen:
Let's check whether the whole system works properly. Create a new project and see if it runs as follows:
Hello World
Python application file.18.223.171.51