On Mac and Linux, use the Python extension in Visual Studio Code. Step 1-1: Create a Visual Studio project and solution In Visual Studio, select File New Project, search for 'Flask', and select the Blank Flask Web Project template. (The template is also found under Python Web in the left-hand list.). Work with Python in Visual Studio on Windows Support for multiple interpreters. Visual Studio's Python Environments window (shown below in a wide, expanded view). Rich editing, IntelliSense, and code comprehension. Visual Studio provides a first-class Python editor, including syntax. Python debug configurations in Visual Studio Code. The Python extension supports debugging of a number of types of Python applications. For a short walkthrough of basic debugging, see Tutorial - Configure and run the debugger.Also see the Flask tutorial.Both tutorials demonstrate core skills like setting breakpoints and stepping through code. Python Tools for Visual Studio. Ann: PTVS is now part of theAzure Machine Learning group! An integrated environment for developing Python in Visual Studio by Microsoft. PTVS is a free/OSS plugin that turns Visual Studio into a Python IDE.
-->


Python is a popular programming language that is reliable, flexible, easy to learn, free to use on all operating systems, and supported by both a strong developer community and many free libraries. The language supports all manners of development, including web applications, web services, desktop apps, scripting, and scientific computing and is used by many universities, scientists, casual developers, and professional developers alike.
Visual Studio provides first-class language support for Python. This tutorial guides you through the following steps:
Prerequisites
- Visual Studio 2017 with the Python workload installed. For instructions, see Work with Python in Visual Studio - Step 0.
- Visual Studio 2019 with the Python workload installed. For instructions, see Work with Python in Visual Studio - Step 0.

You can also use an earlier version of Visual Studio with the Python Tools for Visual Studio installed. See Install Python support in Visual Studio.
Step 1: Create a new Python project
Visual Studio Python Tutorial
A project is how Visual Studio manages all the files that come together to produce a single application, including source code, resources, configurations, and so on. A project formalizes and maintains the relationship between all the project's files as well as external resources that are shared between multiple projects. As such, projects allow your application to effortlessly expand and grow much easier than simply managing a project's relationships in ad hoc folders, scripts, text files, and even your own mind.
Visual Studio Python Interpreter
In this tutorial you begin with a simple project containing a single, empty code file.
In Visual Studio, select File > New > Project (Ctrl+Shift+N), which brings up the New Project dialog. Here you browse templates across different languages, then select one for your project and specify where Visual Studio places files.
To view Python templates, select Installed > Python on the left, or search for 'Python'. Using search is a great way to find a template when you can't remember its location in the languages tree.
Notice how Python support in Visual Studio includes a number of project templates, including web applications using the Bottle, Flask, and Django frameworks. For the purposes of this walkthrough, however, let's start with an empty project.
13: bobbys valentine. Select the Python Application template, specify a name for the project, and select OK.
After a few moments, Visual Studio shows the project structure in the Solution Explorer window (1). The default code file is open in the editor (2). The Properties window (3) also appears to show additional information for any item selected in Solution Explorer, including its exact location on disk.
Take a few moments to familiarize yourself with Solution Explorer, which is where you browse files and folders in your project.
(1) Highlighted in bold is your project, using the name you gave in the New Project dialog. Os lion installer. On disk, this project is represented by a .pyproj file in your project folder.
(2) At the top level is a solution, which by default has the same name as your project. A solution, represented by a .sln file on disk, is a container for one or more related projects. For example, if you write a C++ extension for your Python application, that C++ project could reside within the same solution. The solution might also contain a project for a web service, along with projects for dedicated test programs.
(3) Under your project you see source files, in this case only a single .py file. Selecting a file displays its properties in the Properties window. Double-clicking a file opens it in whatever way is appropriate for that file.
(4) Also under the project is the Python Environments node. When expanded, you see the Python interpreters that are available to you. Expand an interpreter node to see the libraries that are installed into that environment (5).
Right-click any node or item in Solution Explorer to access a menu of applicable commands. For example, the Rename command allows you to change the name of any node or item, including the project and the solution.
Next step
Go deeper
- Python projects in Visual Studio.
- Python for Beginners (python.org)
