Skip to content

Commit 48e5b62

Browse files
cdparkdenrea
andauthored
Feature 449049: Q&M: Light Freshness - VS Python docs - batch 2 (#14147)
* Refresh articles * Minor edit * Alt-text compliance --------- Co-authored-by: Dennis Rea <[email protected]>
1 parent 6fc30a0 commit 48e5b62

7 files changed

+143
-139
lines changed

docs/ide/quickstart-python.md

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

docs/python/tutorial-working-with-python-in-visual-studio-step-01-create-project.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
title: Python in Visual Studio tutorial Step 1, create a project
2+
title: "Tutorial: Create a Project Python in Visual Studio"
33
titleSuffix: ""
4-
description: Overview and Step 1 of a core walkthrough of Python capabilities in Visual Studio, including prerequisites and creating a new Python project.
4+
description: Explore step 1 of a tutorial about Python capabilities in Visual Studio, including prerequisites and creating a new Python project.
55
author: cwebster-99
66
ms.author: cowebster
77
ms.subservice: python
88
ms.topic: tutorial
9-
ms.date: 04/18/2024
9+
ms.date: 07/29/2025
1010
manager: mijacobs
1111
ms.custom: vs-acquisition
1212

1313
# CustomerIntent: As a developer, I want to create Python applications and projects in Visual Studio so I can support my Python development needs.
1414
---
1515

16-
# Tutorial: Work with Python in Visual Studio
16+
# Part 1: Work with Python in Visual Studio
1717

18-
This article is the first step in a six part tutorial series that demonstrates how to work with Python in Visual Studio. Python is a popular programming language that's reliable, flexible, easy to learn, and free to use on all operating systems. A strong developer community and many free libraries provide robust support for working with Python. The language supports all kinds of development, including web applications, web services, desktop apps, scripting, and scientific computing. Many universities, scientists, casual developers, and professional developers use Python. Visual Studio provides first-class language support for Python.
18+
This article is the first step in a six-part tutorial series that demonstrates how to work with Python in Visual Studio. Python is a popular programming language that's reliable, flexible, easy to learn, and free to use on all operating systems. A strong developer community and many free libraries provide robust support for working with Python. The language supports all kinds of development, including web applications, web services, desktop apps, scripting, and scientific computing. Many universities, scientists, casual developers, and professional developers use Python. Visual Studio provides first-class language support for Python.
1919

2020
The six parts in the tutorial series include:
2121

2222
- [Step 1: Create a Python project (this article)](#create-a-new-python-project)
23-
- [Step 2: Write and run code to see Visual Studio IntelliSense at work](tutorial-working-with-python-in-visual-studio-step-02-writing-code.md)
24-
- [Step 3: Create more code in the Interactive REPL window](tutorial-working-with-python-in-visual-studio-step-03-interactive-repl.md)
25-
- [Step 4: Run the completed program in the Visual Studio debugger](tutorial-working-with-python-in-visual-studio-step-04-debugging.md)
26-
- [Step 5: Install packages and manage Python environments](tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md)
27-
- [Step 6: Work with Git](tutorial-working-with-python-in-visual-studio-step-06-working-with-git.md)
23+
- [Step 2: Write and run Python code in Visual Studio](tutorial-working-with-python-in-visual-studio-step-02-writing-code.md)
24+
- [Step 3: Use the Interactive REPL window](tutorial-working-with-python-in-visual-studio-step-03-interactive-repl.md)
25+
- [Step 4: Run code in the Visual Studio debugger](tutorial-working-with-python-in-visual-studio-step-04-debugging.md)
26+
- [Step 5: Install packages in your Python environment](tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md)
27+
- [Step 6: Work with Git in Visual Studio](tutorial-working-with-python-in-visual-studio-step-06-working-with-git.md)
2828

2929
In Step 1 of the tutorial, you learn how to:
3030

@@ -42,9 +42,9 @@ This tutorial begins by creating a simple project that contains a single, empty
4242

4343
::: moniker range="<=vs-2019"
4444

45-
1. In Visual Studio, select **File** > **New** > **Project** to open the **New Project** dialog. You can also use the keyboard shortcut **Ctrl**+**Shift**+**N**. In the dialog, you can browse templates across different languages, select a template for your project, and specify where Visual Studio places files.
45+
1. In Visual Studio, select **File** > **New** > **Project** to open the **New Project** dialog. You can also use the keyboard shortcut **Ctrl**+**Shift**+**N**. In the dialog box, you can browse templates across different languages, select a template for your project, and specify where Visual Studio places files.
4646

47-
1. To view Python templates, select **Installed** > **Python** on the left menu, or search for "Python." The search option is a great way to find a template when you can't remember its location in the languages tree.
47+
1. To view Python templates, select **Installed** > **Python** on the left menu, or search for *Python*. The search option is a great way to find a template when you can't remember its location in the languages tree.
4848

4949
:::image type="content" source="media/tutor-python-1-create-project.png" alt-text="Screenshot showing the Create a new project dialog box with Python project templates." lightbox="media/tutor-python-1-create-project.png":::
5050

@@ -56,10 +56,10 @@ This tutorial begins by creating a simple project that contains a single, empty
5656
::: moniker range=">=vs-2022"
5757

5858
1. In Visual Studio, select **File** > **New** > **Project** or use the keyboard shortcut **Ctrl**+**Shift**+**N**. The **Create a new project** screen opens, where you can search and browse templates across different languages.
59-
59+
6060
1. To view Python templates, search for *python*. Search is a great way to find a template when you can't remember its location in the languages tree.
6161

62-
:::image type="content" source="media/vs-2022/tutor-python-1-create-project-2022.png" alt-text="Screenshot showing the Create a new project dialog box in Visual Studio 2022 with Python project templates." lightbox="media/vs-2022/tutor-python-1-create-project-2022.png":::
62+
:::image type="content" source="media/vs-2022/tutor-python-1-create-project-2022.png" alt-text="Screenshot showing the Create a new project dialog box in Visual Studio with Python project templates." lightbox="media/vs-2022/tutor-python-1-create-project-2022.png":::
6363

6464
Python web support in Visual Studio includes several project templates, such as web applications in the Bottle, Flask, and Django frameworks. When you install Python with the Visual Studio Installer, select **Python Web Support** under **Optional** to install these templates. For this tutorial, start with an empty project.
6565

@@ -103,29 +103,29 @@ Take some time to familiarize yourself with **Solution Explorer**. This window i
103103

104104
::: moniker-end
105105

106-
1. In **Solution Explorer** (**1**), notice the top level item in the structure. This item is your Visual Studio _solution_. By default, your solution name is the same as your project.
107-
106+
1. In **Solution Explorer** (**1**), notice the top-level item in the structure. This item is your Visual Studio _solution_. By default, your solution name is the same as your project.
107+
108108
A solution, which is shown as an _.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 can be in the same solution. The solution might also contain a project for a web service, and projects for dedicated test programs.
109-
109+
110110
1. Locate the item directly under the solution name. This item is your project (**2**). Your project name is the name you entered in the **Create a new project** dialog. Visual Studio uses bold to identify the currently selected project in your solution.
111111

112112
On disk, a _.pyproj_ file in your project folder represents the project.
113113

114114
1. Toggle the **Expand/Collapse** arrow next to the project name to view your project source files.
115115

116-
Visual Studio uses bold to identify which file is the _Start File_ for the program. In this example, you have only a single _.py_ file. (**3**)
117-
116+
Visual Studio uses bold to identify which file is the _Start File_ for the program. In this example, you have only a single _.py_ file (**3**).
117+
118118
1. To view the properties for a file in the **Properties** window, select the file in **Solution Explorer**.
119119

120120
If you don't see the **Properties** window, select the wrench icon in the **Solution Explorer** banner. Double-clicking a file opens it in whatever way is appropriate for that file.
121-
122-
1. Under your project node, locate the **Python Environments** node. **(4)** Expand the node to show the available Python interpreters.
123-
124-
1. Under the **Python Environments** node, expand an interpreter node to see the libraries installed in that environment. (**5**)
125-
121+
122+
1. Under your project node, locate the **Python Environments** node **(4)**. Expand the node to show the available Python interpreters.
123+
124+
1. Under the **Python Environments** node, expand an interpreter node to see the libraries installed in that environment (**5**).
125+
126126
Right-click any node or item in **Solution Explorer** to show a context menu of applicable commands. For example, **Rename** lets you change the name of a node or item, including the project and the solution.
127127

128128
## Next step
129129

130130
> [!div class="nextstepaction"]
131-
> [Step 2: Write and run code](tutorial-working-with-python-in-visual-studio-step-02-writing-code.md)
131+
> [Step 2: Write and run Python code](tutorial-working-with-python-in-visual-studio-step-02-writing-code.md)

docs/python/tutorial-working-with-python-in-visual-studio-step-02-writing-code.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Python in Visual Studio tutorial Step 2, write and run code
2+
title: "Tutorial Step 2: Write and Run Python Code"
33
titleSuffix: ""
4-
description: Step 2 of a core walkthrough of Python capabilities in Visual Studio that demonstrates how to edit code and run a project.
5-
ms.date: 04/18/2024
4+
description: Explore step 2 of a tutorial about Python capabilities in Visual Studio that demonstrates how to edit code and run a project.
5+
ms.date: 07/29/2025
66
ms.topic: tutorial
77
author: cwebster-99
88
ms.author: cowebster
@@ -16,7 +16,9 @@ ms.subservice: python
1616

1717
This article presents Step 2 in the tutorial series _Work with Python in Visual Studio_.
1818

19-
The Visual Studio interactive development environment (IDE) provides various windows that support different development tasks. [Step 1 in the tutorial](tutorial-working-with-python-in-visual-studio-step-01-create-project.md) describes how to manage project files in the **Solution Explorer** window. In Step 2, you use the _editor_ window to work with the _contents_ of files, like source code. The editor is contextually aware of the type of file you're editing. The editor also recognizes the programming language (based on the file extension), and offers features appropriate to that language such as syntax coloring and auto-completion by using IntelliSense.
19+
The Visual Studio integrated development environment (IDE) provides various windows that support different development tasks. [Step 1 in the tutorial](tutorial-working-with-python-in-visual-studio-step-01-create-project.md) describes how to manage project files in the **Solution Explorer** window. In Step 2, you use the _editor_ window to work with the _contents_ of files, like source code.
20+
21+
The editor is contextually aware of the type of file you're editing. The editor also recognizes the programming language (based on the file extension), and offers features appropriate to that language such as syntax coloring and autocompletion by using IntelliSense.
2022

2123
In Step 2 of the tutorial, you learn how to:
2224

@@ -39,19 +41,19 @@ Follow these steps to start writing Python code:
3941

4042
1. In the editor, start to enter the Python function name `print`.
4143

42-
As you enter the function name, Visual Studio IntelliSense displays auto-completion options for your code. The default completion option is highlighted:
44+
As you enter the function name, Visual Studio IntelliSense displays autocompletion options for your code. The default completion option is highlighted:
4345

44-
:::image type="content" source="media/tutor-python-2-intellisense-print-completion.png" alt-text="Screenshot that shows IntelliSense auto-completion options in the editor in Visual Studio. The default completion option is highlighted." border="false" lightbox="media/tutor-python-2-intellisense-print-completion.png":::
46+
:::image type="content" source="media/tutor-python-2-intellisense-print-completion.png" alt-text="Screenshot that shows IntelliSense autocompletion options in the editor in Visual Studio. The default completion option is highlighted." lightbox="media/tutor-python-2-intellisense-print-completion.png":::
4547

4648
To apply the default completion to your code, select the **Tab** keyboard shortcut.
47-
49+
4850
Completions are most helpful when you need to add longer statements or identifiers in your code. IntelliSense shows different completion options based on the statement you're using. For example, when you use parenthesis `()` with a function name, Intellisense recognizes the code as a function call.
4951

5052
1. In the editor, start to enter code to call the `print()` function.
5153

5254
When you enter the open parenthesis `(`, Intellisense shows full usage information for the function. The current argument is in boldface. In this example, the argument is **values: object**:
5355

54-
:::image type="content" source="media/tutor-python-2-intellisense-argument-completion.png" alt-text="Screenshot that shows IntelliSense auto-completion options for the print function in the editor in Visual Studio." border="false" lightbox="media/tutor-python-2-intellisense-argument-completion.png":::
56+
:::image type="content" source="media/tutor-python-2-intellisense-argument-completion.png" alt-text="Screenshot that shows IntelliSense autocompletion options for the print function in the editor in Visual Studio." lightbox="media/tutor-python-2-intellisense-argument-completion.png":::
5557

5658
1. In the editor, complete the code statement so it matches the following example:
5759

@@ -65,7 +67,7 @@ Follow these steps to start writing Python code:
6567

6668
Notice how Visual Studio shows a red underline for code that contains syntax errors.
6769

68-
:::image type="content" source="media/tutor-python-2-intellisense-colors-highlights.png" alt-text="Screenshot that shows IntelliSense syntax coloring and error highlighting in the editor in Visual Studio." border="false" lightbox="media/tutor-python-2-intellisense-colors-highlights.png":::
70+
:::image type="content" source="media/tutor-python-2-intellisense-colors-highlights.png" alt-text="Screenshot that shows IntelliSense syntax coloring and error highlighting in the editor in Visual Studio." lightbox="media/tutor-python-2-intellisense-colors-highlights.png":::
6971

7072
1. Replace the closing quote mark `"` in your code.
7173

@@ -98,7 +100,7 @@ After you have some code in place, you're ready to try running your program. You
98100

99101
1. When you run the program, a console window opens to show the results. This window is similar to what you see when you run a Python interpreter with the Python file (_PythonApplication1.py_) from the command line.
100102

101-
:::image type="content" source="media/tutor-python-2-first-run-program-output.png" alt-text="Screenshot that shows the console window with output for the running program in Visual Studio." border="false" lightbox="media/tutor-python-2-first-run-program-output.png":::
103+
:::image type="content" source="media/tutor-python-2-first-run-program-output.png" alt-text="Screenshot that shows the console window with output for the running program in Visual Studio." lightbox="media/tutor-python-2-first-run-program-output.png":::
102104

103105
1. To close the console window, select any key. You return to the Visual Studio editor.
104106

@@ -112,7 +114,7 @@ Follow these steps to explore more Intellisense completion features:
112114

113115
1. Start to enter the `import sys` statement. When you start to enter `sys`, Visual Studio shows a list of possible modules for the `import` function:
114116

115-
:::image type="content" source="media/tutor-python-2-intellisense-import-sys-completion.png" alt-text="Screenshot that shows how IntelliSense displays the available modules for an import statement in the editor in Visual Studio." border="false" lightbox="media/tutor-python-2-intellisense-import-sys-completion.png":::
117+
:::image type="content" source="media/tutor-python-2-intellisense-import-sys-completion.png" alt-text="Screenshot that shows how IntelliSense displays the available modules for an import statement in the editor in Visual Studio." lightbox="media/tutor-python-2-intellisense-import-sys-completion.png":::
116118

117119
You can scroll through the list to see the full set of available modules.
118120

@@ -126,7 +128,7 @@ Follow these steps to explore more Intellisense completion features:
126128

127129
1. Continue the statement by adding a space followed by the `import` function name. Visual Studio shows the list of possible module members for this use of the `import` function:
128130

129-
:::image type="content" source="media/tutor-python-2-intellisense-import-members-completion.png" alt-text="Screenshot that shows how IntelliSense displays the available module members for the `import` function in the editor in Visual Studio" border="false" lightbox="media/tutor-python-2-intellisense-import-members-completion.png":::
131+
:::image type="content" source="media/tutor-python-2-intellisense-import-members-completion.png" alt-text="Screenshot that shows how IntelliSense displays the available module members for the import function in the editor in Visual Studio." lightbox="media/tutor-python-2-intellisense-import-members-completion.png":::
130132

131133
1. Finish the statement by using the Intellisense completion options to add the `cos` and `radians` members.
132134

0 commit comments

Comments
 (0)