Skip to content

Commit de01762

Browse files
committed
undo 'Select and Hold' instructions in Python docs
1 parent 053cb80 commit de01762

7 files changed

+25
-25
lines changed

docs/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ The Python developer community has produced thousands of useful packages that yo
2626
![Python Environments window](media/environments/environments-default-view-2019.png)
2727

2828
> [!NOTE]
29-
> You can also open the Python Environments window by selecting the Solution Explorer window and using the Ctrl+K, Ctrl+` keyboard shortcut. If the shortcut doesn't work and you can't find the Python Environments window in the menu, it's possible you haven't installed the Python workload. See [How to install Python support in Visual Studio](installing-python-support-in-visual-studio.md) for guidance about how to install Python.
29+
> You can also open the Python Environments window by selecting the Solution Explorer window and using the **Ctrl+K, Ctrl+`** keyboard shortcut. If the shortcut doesn't work and you can't find the Python Environments window in the menu, it's possible you haven't installed the Python workload. See [How to install Python support in Visual Studio](installing-python-support-in-visual-studio.md) for guidance about how to install Python.
3030
3131
2. The environment's **Overview** tab provides quick access to an **Interactive** window for that environment along with the environment's installation folder and interpreters. For example, select **Open interactive window** and an **Interactive** window for that specific environment appears in Visual Studio.
3232

33-
3. Now, create a new project with **File** > **New** > **Project**, selecting the **Python Application** template. In the code file that appears, paste the following code, which creates a cosine wave like the previous tutorial steps, only this time plotted graphically. Alternatively, you can use the project you previously created and replace the code.
33+
3. Now, create a new project with **File** > **New** > **Project**, selecting the **Python Application** template. In the code file that appears, paste the following code, which creates a cosine wave like the previous tutorial steps, only this time plotted graphically. Alternatively, you can use the project you previously created and replace the code.
3434

3535
```python
3636
from math import radians
@@ -45,7 +45,7 @@ The Python developer community has produced thousands of useful packages that yo
4545
main()
4646
```
4747

48-
4. With a Python project open, you can also open the Python Environments window from Solution Explorer by selecting and holding (or right-clicking) on Python Environments and selecting **View All Python Environments**
48+
4. With a Python project open, you can also open the Python Environments window from Solution Explorer by right-clicking **Python Environments** and selecting **View All Python Environments**
4949

5050
![Environment](media/environments/environments-view-all-2019.png)
5151

@@ -55,7 +55,7 @@ The Python developer community has produced thousands of useful packages that yo
5555

5656
## Install packages using the Python Environments window
5757

58-
1. From the Python Environments window, select the default environment for new Python projects and chose the **Packages** tab. You will then see a list of packages that are currently installed in the environment.
58+
1. From the Python Environments window, select the default environment for new Python projects and choose the **Packages** tab. You will then see a list of packages that are currently installed in the environment.
5959

6060
![Packages installed in an environment](media/environments/environments-installed-packages-2019.png)
6161

@@ -71,7 +71,7 @@ The Python developer community has produced thousands of useful packages that yo
7171

7272
> [!NOTE]
7373
> A small progress bar might appear underneath the environment to indicate that Visual Studio is building its IntelliSense database for the newly-installed package. The **IntelliSense** tab also shows more detailed information. Be aware that until that database is complete, IntelliSense features like auto-completion and syntax checking won't be active in the editor for that package.
74-
>
74+
>
7575
> Visual Studio 2017 version 15.6 and later uses a different and faster method for working with IntelliSense, and displays a message to that effect on the **IntelliSense** tab.
7676

7777
## Run the program

docs/python/tutorial-working-with-python-in-visual-studio-step-06-working-with-git.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Visual Studio provides direct integration with local Git repositories and remote
2121

2222
This article provides a basic overview of creating a local Git repository for an existing project, and familiarizing yourself with some of Visual Studio's Git-related features.
2323

24-
1. With a project open in Visual Studio, such as the project from the [previous step](tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md), select and hold (or right-click) the solution and select **Add Solution to Source Control**. Visual Studio creates a local Git repository that contains your project code.
24+
1. With a project open in Visual Studio, such as the project from the [previous step](tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md), right-click the solution and select **Add Solution to Source Control**. Visual Studio creates a local Git repository that contains your project code.
2525

2626
1. When Visual Studio detects that the project is managed in a Git repository Git-related controls appear along the bottom right corner of the Visual Studio window. The controls show pending commits, changes, the name of the repository, and the branch. Hover over the controls to see additional information.
2727

docs/python/visual-studio-ide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Some of the popular features in Visual Studio that help you to be more productiv
5252

5353
- [Refactoring](refactoring-python-code.md)
5454

55-
By selecting and holding (or right-clicking) on a piece of code and selecting **Quick actions and Refactorings**, Visual Studio provides you with operations such as intelligent renaming of variables, extracting one or more lines of code into a new method, changing the order of method parameters, and more.
55+
By right-clicking on a piece of code and selecting **Quick actions and Refactorings**, Visual Studio provides you with operations such as intelligent renaming of variables, extracting one or more lines of code into a new method, changing the order of method parameters, and more.
5656

5757
![Refactoring in Visual Studio](media/tour-ide-refactor-extract-method.png)
5858

@@ -89,8 +89,8 @@ Some of the popular features in Visual Studio that help you to be more productiv
8989
::: moniker-end
9090

9191
- [Collaborate using Visual Studio](/visualstudio/liveshare/)
92-
93-
Visual Studio Live Share enables you to collaboratively edit and debug with others in real time, regardless of what programming language you're using or app types you're building.
92+
93+
Visual Studio Live Share enables you to collaboratively edit and debug with others in real time, regardless of what programming language you're using or app types you're building.
9494

9595
- [Python Interactive REPL](python-interactive-repl-in-visual-studio.md)
9696

docs/python/working-with-c-cpp-python-in-visual-studio.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@ Follow the instructions in this section to create two identical C++ projects nam
9797

9898
1. Make sure the `PYTHONHOME` environment variable is set to the Python interpreter you want to use. The C++ projects in Visual Studio rely on this variable to locate files such as *python.h*, which are used when creating a Python extension.
9999

100-
1. Select and hold (or right-click) the solution in **Solution Explorer** and select **Add** > **New Project**. A Visual Studio solution can contain both Python and C++ projects together (which is one of the advantages of using Visual Studio for Python).
100+
1. Right-click the solution in **Solution Explorer** and select **Add** > **New Project**. A Visual Studio solution can contain both Python and C++ projects together (which is one of the advantages of using Visual Studio for Python).
101101

102102
1. Search on "C++", select **Empty project**, specify the name "superfastcode" ("superfastcode2" for the second project), and select **OK**.
103103

104104
> [!Tip]
105105
> With the **Python native development tools** installed in Visual Studio, you can start with the **Python Extension Module** template instead, which has much of what's described below already in place. For this walkthrough, though, starting with an empty project demonstrates building the extension module step by step. Once you understand the process, the template saves you time when writing your own extensions.
106106

107-
1. Create a C++ file in the new project by selecting and holding (or right-clicking) the **Source Files** node, then select **Add** > **New Item**, select **C++ File**, name it `module.cpp`, and select **OK**.
107+
1. Create a C++ file in the new project by right-clicking the **Source Files** node, then select **Add** > **New Item**, select **C++ File**, name it `module.cpp`, and select **OK**.
108108

109109
> [!Important]
110110
> A file with the *.cpp* extension is necessary to turn on the C++ property pages in the steps that follow.
111111

112-
1. Select and hold (or right-click) the C++ project in **Solution Explorer**, select **Properties**.
112+
1. Right-click the C++ project in **Solution Explorer**, select **Properties**.
113113

114114
1. At the top of the **Property Pages** dialog that appears, set **Configuration** to **All Configurations** and **Platform** to **Win32**.
115115

@@ -126,14 +126,14 @@ Follow the instructions in this section to create two identical C++ projects nam
126126
| **Linker** > **General** | **Additional Library Directories** | Add the Python *libs* folder containing *.lib* files as appropriate for your installation, for example, `c:\Python36\libs`. (Be sure to point to the *libs* folder that contains *.lib* files, and *not* the *Lib* folder that contains *.py* files.) |
127127
128128
> [!Tip]
129-
> If you don't see the C/C++ tab in the project properties, it's because the project doesn't contain any files that it identifies as C/C++ source files. This condition can occur if you create a source file without a *.c* or *.cpp* extension. For example, if you accidentally entered `module.coo` instead of `module.cpp` in the new item dialog earlier, then Visual Studio creates the file but doesn't set the file type to "C/C+ Code," which is what activates the C/C++ properties tab. Such misidentification remains the case even if you rename the file with `.cpp`. To set the file type properly, select and hold (or right-click) the file in **Solution Explorer**, select **Properties**, then set **File Type** to **C/C++ Code**.
129+
> If you don't see the C/C++ tab in the project properties, it's because the project doesn't contain any files that it identifies as C/C++ source files. This condition can occur if you create a source file without a *.c* or *.cpp* extension. For example, if you accidentally entered `module.coo` instead of `module.cpp` in the new item dialog earlier, then Visual Studio creates the file but doesn't set the file type to "C/C+ Code," which is what activates the C/C++ properties tab. Such misidentification remains the case even if you rename the file with `.cpp`. To set the file type properly, right-click the file in **Solution Explorer**, select **Properties**, then set **File Type** to **C/C++ Code**.
130130

131131
> [!Warning]
132132
> Always set the **C/C++** > **Code Generation** > **Runtime Library** option to **Multi-threaded DLL (/MD)**, even for a debug configuration, because this setting is what the non-debug Python binaries are built with. With CPython, if you happen to set the **Multi-threaded Debug DLL (/MDd)** option, building a **Debug** configuration produces error **C1189: Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG**. Furthermore, if you remove `Py_LIMITED_API` (which is required with CPython, but not PyBind11) to avoid the build error, Python crashes when attempting to import the module. (The crash happens within the DLL's call to `PyModule_Create` as described later, with the output message of **Fatal Python error: PyThreadState_Get: no current thread**.)
133133
>
134134
> The /MDd option is used to build the Python debug binaries (such as *python_d.exe*), but selecting it for an extension DLL still causes the build error with `Py_LIMITED_API`.
135135

136-
1. Select and hold (or right-click) the C++ project and select **Build** to test your configurations (both **Debug** and **Release**). The *.pyd* files are located in the **solution** folder under **Debug** and **Release**, not the C++ project folder itself.
136+
1. Right-click the C++ project and select **Build** to test your configurations (both **Debug** and **Release**). The *.pyd* files are located in the **solution** folder under **Debug** and **Release**, not the C++ project folder itself.
137137

138138
1. Add the following code to the C++ project's *module.cpp* file:
139139

@@ -273,15 +273,15 @@ Now that you have the DLLs structured as Python extensions, you can refer to the
273273

274274
There are two ways to make the DLL available to Python.
275275

276-
The first method works if the Python project and the C++ project are in the same solution. Go to **Solution Explorer**, select and hold (or right-click) the **References** node in your Python project, and then select **Add Reference**. In the dialog that appears, select the **Projects** tab, select both the **superfastcode** and **superfastcode2** projects, and then select **OK**.
276+
The first method works if the Python project and the C++ project are in the same solution. Go to **Solution Explorer**, right-click the **References** node in your Python project, and then select **Add Reference**. In the dialog that appears, select the **Projects** tab, select both the **superfastcode** and **superfastcode2** projects, and then select **OK**.
277277

278278
![Adding a reference to the superfastcode project](media/cpp-add-reference.png)
279279

280280
The alternate method, described in the following steps, installs the module in the global Python environment, making it available to other Python projects as well. (Doing so typically requires that you refresh the IntelliSense completion database for that environment in Visual Studio 2017 version 15.5 and earlier. Refreshing is also necessary when removing the module from the environment.)
281281

282282
1. If you're using Visual Studio 2017 or later, run the Visual Studio installer, select **Modify**, select **Individual Components** > **Compilers, build tools, and runtimes** > **Visual C++ 2015.3 v140 toolset**. This step is necessary because Python (for Windows) is itself built with Visual Studio 2015 (version 14.0) and expects that those tools are available when building an extension through the method described here. (Note that you may need to install a 32-bit version of Python and target the DLL to Win32 and not x64.)
283283

284-
1. Create a file named *setup.py* in the C++ project by selecting and holding (or right-clicking) the project and selecting **Add** > **New Item**. Then select **C++ File (.cpp)**, name the file `setup.py`, and select **OK** (naming the file with the *.py* extension makes Visual Studio recognize it as Python despite using the C++ file template). When the file appears in the editor, paste the following code into it as appropriate to the extension method:
284+
1. Create a file named *setup.py* in the C++ project by right-clicking the project and selecting **Add** > **New Item**. Then select **C++ File (.cpp)**, name the file `setup.py`, and select **OK** (naming the file with the *.py* extension makes Visual Studio recognize it as Python despite using the C++ file template). When the file appears in the editor, paste the following code into it as appropriate to the extension method:
285285

286286
**CPython extensions (superfastcode project):**
287287

@@ -360,7 +360,7 @@ After you've made the DLL available to Python as described in the previous secti
360360
[fast_tanh2(x) for x in d] (PyBind11 C++ extension) took 0.204 seconds
361361
```
362362

363-
If the **Start Without Debugging** command is disabled, select and hold (or right-click) the Python project in **Solution Explorer** and select **Set as Startup Project**.
363+
If the **Start Without Debugging** command is disabled, right-click the Python project in **Solution Explorer** and select **Set as Startup Project**.
364364

365365
1. Try increasing the `COUNT` variable so that the differences are more pronounced. A **Debug** build of the C++ module also runs slower than a **Release** build because the **Debug** build is less optimized and contains various error checks. Feel free to switch between those configurations for comparison.
366366

@@ -371,7 +371,7 @@ After you've made the DLL available to Python as described in the previous secti
371371

372372
Visual Studio supports debugging Python and C++ code together. This section walks through the process using the **superfastcode** project; the steps are the same for the **superfastcode2** project.
373373

374-
1. Select and hold (or right-click) the Python project in **Solution Explorer**, select **Properties**, select the **Debug** tab, and then select the **Debug** > **Enable native code debugging** option.
374+
1. Right-click the Python project in **Solution Explorer**, select **Properties**, select the **Debug** tab, and then select the **Debug** > **Enable native code debugging** option.
375375

376376
> [!Tip]
377377
> When you enable native code debugging, the Python output window may disappear immediately when the program has completed without giving you the usual **Press any key to continue** pause. To force a pause, add the `-i` option to the **Run** > **Interpreter Arguments** field on the **Debug** tab when you enable native code debugging. This argument puts the Python interpreter into interactive mode after the code finishes, at which point it waits for you to press **Ctrl**+**Z** > **Enter** to exit. (Alternately, if you don't mind modifying your Python code, you can add `import os` and `os.system("pause")` statements at the end of your program. This code duplicates the original pause prompt.)

docs/rtvs/getting-started-with-r.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ As an example, the following steps create a little code to explore the [Central
7979
plot(density(pop), main = "Population Density", xlab = "X", ylab = "")
8080
```
8181

82-
1. To quickly see the results, select all the code (**Ctrl**+**A**), then press **Ctrl**+**Enter** or select and hold (or right-click) and select **Execute In Interactive**. All the selected code is run in the interactive window as if you typed it directly, showing the result in a plot window:
82+
1. To quickly see the results, select all the code (**Ctrl**+**A**), then press **Ctrl**+**Enter** or right-click and select **Execute In Interactive**. All the selected code is run in the interactive window as if you typed it directly, showing the result in a plot window:
8383

8484
![Display of a plot in Visual Studio](media/getting-started-08-plot1.png)
8585

@@ -140,7 +140,7 @@ One of the key strengths of Visual Studio is its debugging UI. RTVS builds on to
140140

141141
![Stopping on a breakpoint in the Visual Studio debugger](media/getting-started-12-debug2.png)
142142

143-
1. During debugging, Visual Studio provides the ability to step through your code line by line. You can also step into functions, step over them, or step out of them to the calling context. These capabilities, along with others, can be found on the **Debug** menu, the context menu in the editor (accessible by selecting and holding or right-clicking), and the Debug toolbar:
143+
1. During debugging, Visual Studio provides the ability to step through your code line by line. You can also step into functions, step over them, or step out of them to the calling context. These capabilities, along with others, can be found on the **Debug** menu, the right-click context menu in the editor, and the Debug toolbar:
144144

145145
![Debug toolbar in Visual Studio](media/getting-started-13-debug3.png)
146146

0 commit comments

Comments
 (0)