

# Create an instance of the Flask class that is the WSGI application.
#How to use python in visual studio 2010 code#
Visual Studio automatically opens the file in an editor window.Ĭopy the following code and paste it into app.py: from flask import Flask For Name, enter app.py, and then select Add. In the dialog that appears, select empty. Right-click the project in Solution Explorer and select Add > New Item.
#How to use python in visual studio 2010 install#
Use the following steps to install the Flask library into the default global environment that Visual Studio uses for this project. You use one of these templates later in this Quickstart. Visual Studio provides many templates for web apps. Web apps in Python almost always use one of the many available Python libraries to handle low-level details like routing web requests and shaping responses. For example, running a Python app project can automatically build a second project, like a C++ extension that the Python app uses. Projects in a solution can also reference one another. The solution stores configuration settings that aren't specific to a project. Question: What is the "solution" shown in Solution Explorer?Īnswer: A Visual Studio solution is a container that helps you manage one or more related projects as a group. pyproj file contains build information for each file, maintains information to integrate with source-control systems, and helps organize your application into logical components. pyproj file, identifies all the source and content files associated with your project. A Visual Studio project helps manage this complexity.

Applications can involve auto-generated files, JavaScript for web applications, and other components. Question: What's the advantage of creating a project in Visual Studio for a Python application?Īnswer: Python applications are typically defined by using only folders and files, but this simple structure can become burdensome as applications grow larger. The project is empty at this point because it contains no other files. The new project opens in Solution Explorer in the right pane. The Solution name automatically updates to match the Project name. In the Configure your new project dialog box, enter "HelloPython" for Project name, specify a location, and then select Create. In the Installer, select the Python development workload, and under Installation details, select Python web support. If you don't see the Python web project templates, select Tools > Get Tools and Features to run the Visual Studio Installer. Choose Web Project from the list, and then select Next: In the Create a new project dialog box, enter "Python web" in the search field at the top. On the start screen, select Create a new project.
