Skip to content

Commit 6c7f43b

Browse files
author
Kraig Brockschmidt
authored
Merge pull request MicrosoftDocs#511 from Microsoft/kraigb-python
Options page for Python
2 parents 5f996af + f17964b commit 6c7f43b

26 files changed

+214
-76
lines changed

Diff for: docs/python/TOC.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
### [Cross-platform Remote Debugging](debugging-cross-platform-remote.md)
2222
### [Python/C++ Mixed-Mode Debugging](debugging-mixed-mode.md)
2323
### [Symbols for Mixed-Mode Debugging](debugging-symbols-for-mixed-mode.md)
24+
## [Options](options.md)
2425
## [Profiling](profiling.md)
2526
## [Unit Testing](unit-testing.md)
2627
## [Using the Cookiecutter Extension](cookiecutter.md)

Diff for: docs/python/code-editing.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Editing Python Code in Visual Studio | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: 4/10/2017
4+
ms.date: 6/6/2017
55
ms.prod: "visual-studio-dev15"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -42,6 +42,8 @@ In this topic:
4242

4343
For general documentation on editing code in Visual Studio, see [Writing Code in the Code and Text Editor](../ide/writing-code-in-the-code-and-text-editor.md). Also see [Outlining in Visual Studio](../ide/outlining.md), which helps you stay focused on particular sections of your code. Python support includes using the Visual Studio Object Browser (**View > Other Windows > Object Browser** or Ctrl+W,J) for inspecting classes defined in each module and the functions defined in those classes.
4444

45+
The editor is also integrated with the interactive window in Visual Studio, making it easy to exchange code between the two. See [Getting Started - Using the interactive REPL window])(getting-started.md#using-the-interactive-repl-window) and [Using the interactive window - Send code to interactive command](interactive-repl.md#send-code-to-interactive-command) for details.
46+
4547
For an introduction to editing Python code, see [Getting Started with Python in Visual Studio, Part 3: Editing](https://youtu.be/uZGZNEyyeKs?list=PLReL099Y5nRdLgGAdrb_YeTdEnd23s6Ff) (youtube.com, 3m48s):
4648

4749
> [!VIDEO https://www.youtube.com/embed/uZGZNEyyeKs]
@@ -87,8 +89,7 @@ Typing @ starts a decorator and shows potential decorators. Many of these items
8789
![Decorator completion](media/code-editing-completion-decorator.png)
8890

8991
> [!Tip]
90-
> You can configure the behavior of completions through **Tools > Options > Text Editor > Python > Advanced"**. Among these, **Filter list based on search string**: applies filtering of completion suggestions as you type (default is checked), and **Member completion displays intersection of members** shows only completions that are supported by all possible types (default is unchecked).
91-
92+
> You can configure the behavior of completions through **Tools > Options > Text Editor > Python > Advanced"**. Among these, **Filter list based on search string**: applies filtering of completion suggestions as you type (default is checked), and **Member completion displays intersection of members** shows only completions that are supported by all possible types (default is unchecked). See [Options - completion results](options.md#completion-results).
9293
9394
### Signature help
9495

@@ -116,7 +117,8 @@ To customize the colors used,go to **Tools > Options > Environment > Fonts and C
116117
![Fonts and Colors options](media/code-editing-customize-colors.png)
117118

118119
> [!Tip]
119-
> To disable code coloring, go to **Tools > Options > Text Editor > Python > Advanced** and clear **Miscellaneous Options > Color names based on type**.
120+
> To disable code coloring, go to **Tools > Options > Text Editor > Python > Advanced** and clear **Miscellaneous Options > Color names based on type**. See [Options - Miscellaneous Options](options.md#miscellaneous-options).
121+
120122

121123
## Code snippets
122124

@@ -128,8 +130,8 @@ You can see the available code snippets in the Code Snippets Manager (**Tools >
128130

129131
![Code Snippets Manager](media/code-editing-code-snippets-manager.png)
130132

131-
To create your own snippets, see [Walkthrough: Creating a Code Snippet](https://docs.microsoft.com/en-us/visualstudio/ide/walkthrough-creating-a-code-snippet).
132-
Code snippets can be customized by [creating a code snippet](https://msdn.microsoft.com/en-us/library/ms165394.aspx) and importing it through the
133+
To create your own snippets, see [Walkthrough: Creating a Code Snippet](../ide/walkthrough-creating-a-code-snippet.md).
134+
Code snippets can be customized by [creating a code snippet](https://msdn.microsoft.com/library/ms165394.aspx) and importing it through the
133135

134136
If you write a great code snippet that you'd like to share, feel free to post it in a gist and [let us know](https://github.com/Microsoft/PTVS/issues). We may be able to include it in a future release of Visual Studio.
135137

Diff for: docs/python/code-pylint.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Just right-click a Python project in Solution Explorer and select **Python > Run
3838

3939
![PyLint command on context menu for Python projects](media/code-pylint-command.png)
4040

41-
Using the commands prompt you to install PyLint into your active environment if needed.
41+
Using this command prompts you to install PyLint into your active environment if needed.
4242

4343
PyLint warnings and errors appear in the Error List window:
4444

Diff for: docs/python/debugging.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debugging Python in Visual Studio | Microsoft Docs
33
ms.custom: ""
4-
ms.date: 5/8/2017
4+
ms.date: 6/6/2017
55
ms.prod: "visual-studio-dev15"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -207,6 +207,6 @@ The Debug Interactive window supports special meta-commands in addition to the [
207207

208208
Note that the standard debugger windows such as Processes, Threads and Call Stack are not synchronized with the Debug Interactive window. This means that changing the active process, thread, or frame in the Debug Interactive window will not affect the other debugger windows, and similarly, changing the active process, thread, or frame in the other debugger windows will not affect the Debug Interactive window.
209209

210-
The Debug Interactive window has its own set of options, which you can access through **Tools > Options > Python Tools >Debug Interactive Window**. Unlike the regular Python Interactive window, which has a separate instance for each Python environment, there is only one Debug Interactive window and it always uses the Python interpreter for the process being debugged.
210+
The Debug Interactive window has its own set of options, which you can access through **Tools > Options > Python Tools > Debug Interactive Window**. Unlike the regular Python Interactive window, which has a separate instance for each Python environment, there is only one Debug Interactive window and it always uses the Python interpreter for the process being debugged. See [Options - Debugging options](options.md#debugging-options).
211211

212212
![Debug Interactive Window Options](media/debugging-interactive-options.png)

Diff for: docs/python/interactive-repl-ipython.md

+8-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: IPython REPL in Visual Studio | Microsoft Docs
33
ms.custom: ""
4-
ms.date: 5/30/2017
4+
ms.date: 6/6/2017
55
ms.prod: "visual-studio-dev15"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -32,34 +32,18 @@ translation.priority.ht:
3232

3333
# Using IPython in the Interactive Window
3434

35-
The Visual Studio interactive window in IPython mode is an advanced yet user-friendly interactive development environment that has Interactive Parallel Computing features. In this topic we'll walk through using IPython in the Visual Studio interactive window. For this you should have the [Anaconda](https://www.continuum.io) environment is installed, which includes IPython and the necessary libraries.
35+
The Visual Studio interactive window in IPython mode is an advanced yet user-friendly interactive development environment that has Interactive Parallel Computing features. In this topic we'll walk through using IPython in the Visual Studio interactive window, in which all of the regular [interactive window](interactive-repl.md) features are also available.
36+
37+
For this walkthrough you should have the [Anaconda](https://www.continuum.io) environment installed, which includes IPython and the necessary libraries.
3638

3739
> [!Note]
3840
> IronPython does not support IPython, despite the fact that you can select it on the Interactive Options form. You can upvote the [feature request](https://github.com/Microsoft/PTVS/issues/84) or implement it if you'd like.
3941
40-
1. Make sure the IPython package is installed correctly by going to your Python installation directory and starting IPython in Pylab mode:
41-
42-
```bash
43-
ipython --pylab
44-
```
45-
46-
1. Enter the following:
47-
48-
```python
49-
x = linspace(0, 5, 10)
50-
y = x ** 2
51-
plot(x, y, 'r')
52-
```
53-
54-
1. If everything is configured properly, you should see something like this:
55-
56-
![IPython configuration output ](media/ipython-repl-01.png)
57-
5842
1. Open Visual Studio, switch to the Python Environments window (**View > Other Windows > Python Environments**), and select the Python environment that appeared when you started IPython.
5943

6044
1. Look at the **Packages** (or **pip**) tab and ensure that `IPython` and `matplotlib` are listed. If not, install them here.
6145

62-
1. Select the **Overview** tab and select **Use IPython interactive mode.** (In Visual Studio 2015, select **Configure interactive options** to open the **Options** dialog, then set **Interactive Mode** to IPython, and select **OK**)/
46+
1. Select the **Overview** tab and select **Use IPython interactive mode.** (In Visual Studio 2015, select **Configure interactive options** to open the **Options** dialog, then set **Interactive Mode** to IPython, and select **OK**).
6347

6448
1. Select **Open interactive window** to bring up the interactive window in IPython mode. You may need to reset the window if you have just changed the interactive mode; you might also need to press Enter if only a >>> prompt appears.
6549

@@ -77,7 +61,7 @@ The Visual Studio interactive window in IPython mode is an advanced yet user-fri
7761

7862
![Inline graph in the interactive window](media/ipython-repl-04.png)
7963

80-
1. Instead of typing in the REPL, you can instead write code in the editor, select it, right-click, and select the **Send to interactive** command (Ctrl-E,E). Try pasting the code below into a new file in the editor, selecting it with Ctrl-A, then sending to the interactive window. (Note that when Visual Studio sends code to the interactive window, it sends it as one unit to avoid giving you intermediate or partial graphs. Also note that if you don't have a Python project open with a different environment selected, Visual Studio will open an interactive window for whatever environment is selected as your default in the **Python Environments** window.)
64+
1. Instead of typing in the REPL, you can instead write code in the editor, select it, right-click, and select the **Send to interactive** command (or press Ctrl-Enter). Try pasting the code below into a new file in the editor, selecting it with Ctrl-A, then sending to the interactive window. (Note that Visual Studio sends the code as one unit to avoid giving you intermediate or partial graphs. Also note that if you don't have a Python project open with a different environment selected, Visual Studio opens an interactive window for whatever environment is selected as your default in the **Python Environments** window.)
8165

8266
```python
8367
from mpl_toolkits.mplot3d import Axes3D
@@ -108,6 +92,6 @@ IPython has many other useful features such as escaping to the system shell, var
10892

10993
## Related topics
11094

111-
- Using the ptvsd library, you can attach the Visual Studio debugger to Python running on remote machines. See [Remotely Debugging Python Code on Azure](https://docs.microsoft.com/visualstudio/python/debugging-azure-remote) and [Remotely Debugging Python Code](https://docs.microsoft.com/visualstudio/python/debugging-cross-platform-remote)
95+
- To use Jupyter easily and without installation, try the free [Azure Notebooks](https://notebooks.azure.com/) hosted service that lets you keep and share your notebooks with others.
11296

113-
- Azure supports Jupyter (formerly part of IPython) on a Windows or Linux virtual machine, and also provides Azure Notebooks. For details, see [Creating an Azure VM. installing Jupyter, and running Jupyter Notebook on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-jupyter-notebook).
97+
- You can also run Jupyter (formerly known as IPython) on your own Windows or Linux virtual machine on Azure. For details, see [Creating an Azure VM. installing Jupyter, and running Jupyter Notebook on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-jupyter-notebook).

0 commit comments

Comments
 (0)