Skip to content

Commit e5bd7f0

Browse files
Merge pull request #10633 from cwebster-99/pythonupdates
Updating Python files from issue tickets
2 parents c2aa6ab + d3ade66 commit e5bd7f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/python/debugging-mixed-mode-c-cpp-python-in-visual-studio.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Mixed-mode debugging features include the following, as explained in this articl
4444
4545
1. When attaching the mixed-mode debugger to an existing process (**Debug** > **Attach to Process**), use the **Select** button to open the **Select Code Type** dialog. Then set the **Debug these code types** option and select **Python (native)** from the list:
4646

47-
![Screenshot of choosing the Python (native) code type for mixed-mode debugging.](media/mixed_mode_debugging_attach_type_updated.png)
47+
48+
![Screenshot of user selecting the Python (native) code type](media/mixed_mode_debugging_attach_type_updated.png)
49+
4850

4951
The code type settings are persistent, so if you want to disable mixed-mode debugging when attaching to a different process later, clear the **Python (native)** code type and apply the **Native** code type.
5052

@@ -54,6 +56,8 @@ Mixed-mode debugging features include the following, as explained in this articl
5456

5557
1. To make the source code for standard Python itself available when debugging, visit [https://www.python.org/downloads/source/](https://www.python.org/downloads/source/), download the archive appropriate for your version, and extract it to a folder. You then point Visual Studio to specific files in that folder at whatever point it prompts you.
5658

59+
Using this method for virtual environments, beware that Python for Windows uses a stub *python.exe* for venvs, Visual Studio finds and loads *python.exe* as a subprocess. For Python 3.8 onward - when starting a debug session, since mixed-mode doesn't support multi-process debugging, it ends up debugging just that stub process, instead of the actual application. For attach scenarios, the workaround is to attach to the correct *python.exe*. For launch/F5, you can create your virtual environment using the following command `C:\Python310-64\python.exe -m venv venv --symlinks` (by default, only admins can create symlinks on Windows). For Python versions prior to 3.8, mixed mode debugging should work as expected with venvs. Running in a global environment will not cause these issues for any version of Python.
60+
5761
## Enable mixed-mode debugging in a C/C++ project
5862

5963
Visual Studio (2017 version 15.5 and later) supports mixed-mode debugging from a C/C++ project (for example, when [embedding Python in another application as described on python.org](https://docs.python.org/3/extending/embedding.html)). To enable mixed-mode debugging, configure the C/C++ project to launch **Python/Native Debugging**:

docs/python/learn-django-in-visual-studio-step-04-full-django-project-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Nevertheless, to use an existing virtual environment, follow the steps below:
8585

8686
## Step 4-2: Understand the views and page templates created by the project template
8787

88-
As you observe when you run the project, the app contains three views: Home, About, and Contact. The code for these views is found in the *app/views* folder. Each view function calls `django.shortcuts.render` with the path to a template and a simple dictionary object. For example, the About page is handled by the `about` function:
88+
As you observe when you run the project, the app contains three views: Home, About, and Contact. The code for these views is found in the *views.py* file. Each view function calls `django.shortcuts.render` with the path to a template and a simple dictionary object. For example, the About page is handled by the `about` function:
8989

9090
```python
9191
def about(request):

0 commit comments

Comments
 (0)