Skip to content

Commit df83858

Browse files
author
Kraig Brockschmidt
authored
Merge pull request #1350 from brettcannon/py-doc-touchups
Changes for various issues related to Python
2 parents b87ca36 + 623204c commit df83858

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

docs/languages/python.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ MetaDescription: Learn about Visual Studio Code features (code completion, debug
1111

1212
Working with Python in Visual Studio Code, using the [Microsoft Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python), is simple, fun, and productive. The extension leverages all of VS Code's power to provide auto complete and IntelliSense, linting, debugging, and unit testing, along with control over your Python environments.
1313

14-
Note that the Python extension depends on a separate installation of Python itself. For details, see [Tutorial - Prerequisites](/docs/python/python-tutorial.md#prerequisites).
14+
## Install Python and the Python Extension
15+
16+
The [tutorial](/docs/python/python-tutorial.md) guides you through installing Python and using the extension.
1517

1618
## Autocomplete and IntelliSense
1719

docs/python/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To debug an app that requires administrator privileges, use `"console": "externa
137137

138138
Remote debugging allows you to step through a program locally within VS Code while it's executed on a remote computer. In this case, it's necessary to have the source code on both computers.
139139

140-
1. On both development and remote computers, install the [ptvsd library](https://pypi.org/project/ptvsd/) (version `3.0.0` - later versions are not yet supported [#514](https://github.com/Microsoft/vscode-python/issues/514)).
140+
1. On both development and remote computers, install [ptvsd 3.0.0](https://pypi.org/project/ptvsd/3.0.0/) (version `3.0.0` **exactly** - later versions are not yet supported [#514](https://github.com/Microsoft/vscode-python/issues/514)).
141141
2. In the source code on both computers, add the following lines, replacing *my_secret* with the appropriate passphrase to authenticate remote debugging, and replacing *address* with the appropriate IP address (or `localhost`) and port number:
142142

143143
```python
@@ -240,7 +240,7 @@ There are many reasons why the debugger may not work; oftentimes the debug conso
240240

241241
| Cause | Solution |
242242
| --- | --- |
243-
| The path to the python executable is incorrect | Check the value in the `pythonPath` setting of `launch.json`, restarting VS Code if you make a change. |
243+
| The path to the python executable is incorrect | Check the value in the `pythonPath` setting of `settings.json`. |
244244
| Invalid expressions in watch window (see detailed output below) | Clear all expressions from the Watch window restart the debugger. |
245245

246246
Detailed output for invalid expressions:

docs/python/editing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ The Python extension supports source code formatting using either autopep8 (the
7676

7777
| Setting<br/>(python.formatting.) | Default value | Description |
7878
| --- | --- | --- |
79-
| outputWindow | `"Python"` | The name of the output window for formatting messages. |
8079
| provider | `"autopep8"` | Specifies the formatter to use, either "autopep8" or "yapf". |
8180

8281
### Formatter-specific settings
@@ -101,7 +100,7 @@ If formatting fails, check the following possible causes:
101100

102101
| Cause | Solution |
103102
| --- | --- |
104-
| The path to the python interpreter is incorrect | Check the `pythonPath` setting. Restart VS Code if you make a correction. |
103+
| The path to the python interpreter is incorrect | Check the `pythonPath` setting. |
105104
| The formatter is not installed in the current environment | Open a command prompt, navigate to the location specified in the `pythonPath` setting, and run `pip install` for the formatter.
106105
| The path to the formatter is incorrect. | Check the value of the appropriate `python.formatting.<formatter>Path` setting. |
107106
| Custom arguments for the formatter are incorrect. | Check that the appropriate `python.formatting.<formatter>Path` setting does not contain arguments, and that `python.formatting.<formatter>Args` contains an array of individual argument items such as `"python.formatting.yapfArgs": ["--style", "{based_on_style: chromium, indent_width: 20}"]`.

docs/python/environments.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ If the interpreter you want to use is not located automatically, you can set the
3939

4040
For example:
4141

42-
Windows:
43-
```json
44-
"python.pythonPath": "c:/python36/python.exe"
45-
```
46-
47-
Mac/Linux:
48-
```json
49-
"python.pythonPath": "/home/python36/python"
50-
```
42+
- Windows:
43+
```json
44+
"python.pythonPath": "c:/python36/python.exe"
45+
```
46+
- Mac/Linux:
47+
```json
48+
"python.pythonPath": "/home/python36/python"
49+
```
5150

5251
## Environment variables in the interpreter path
5352

@@ -81,7 +80,6 @@ To use a Python interpreter that's installed in a virtual environment:
8180

8281
2. Configure the same `python.pythonPath` variable in `launch.json`.
8382
3. Ensure that the the libraries and modules you plan on using for linting are installed within the virtual environment.
84-
4. Restart VS Code.
8583

8684
## Python interpreter for debugging
8785

docs/python/python-tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Let's get started by creating the simplest "Hello World" Python application.
1616

1717
To successfully complete this tutorial, you must do the following:
1818

19-
1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
19+
1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python).
2020

2121
2. Install whichever version of Python you want to use. Options include:
2222

2323
- The built-in Python installation on Linux.
24-
- An installation through Homebrew on Linux or macOS.
25-
- A download from [python.org](https://www.python.org/)
26-
- A download from [Anaconda](https://www.anaconda.com/download/).
24+
- An installation through [Homebrew](https://brew.sh/) on macOS using `brew install python3` (the system install of Python on macOS is not supported).
25+
- A download from [python.org](https://www.python.org/downloads/).
26+
- A download from [Anaconda](https://www.anaconda.com/download/) (for data science purposes).
2727

2828
3. From within VS Code, select a version of Python using the **Python: Select Interpreter** command on the **Command Palette** (`kb(workbench.action.showCommands)`), or by using the **Select Python Environment** option on the Status Bar if available:
2929

docs/python/settings-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Workspace symbols are symbols in C source code generated by the ctags tool (desc
5050

5151
| Setting<br/>(python.formatting.) | Default | Description | See also |
5252
| --- | --- | --- | --- |
53-
| outputWindow | `"Python"` | The name of the output window for formatting messages. |[Editing - Formatting](/docs/python/editing.md#formatting) |
5453
| provider | `"autopep8"` | Specifies the formatter to use, either "autopep8" or "yapf". |[Editing - Formatting](/docs/python/editing.md#formatting) |
5554
| autopep8Path | `"autopep8"` | Path to autopep8 | [Editing - Formatting](/docs/python/editing.md#formatting) |
5655
| autopep8Args| `[]` | Arguments for autopep8, each argument as a separate item in the array. | [Editing - Formatting](/docs/python/editing.md#formatting) |

0 commit comments

Comments
 (0)