Skip to content

Commit

Permalink
Merge pull request #6965 from ntrogh/ntrogh-python-qs-images
Browse files Browse the repository at this point in the history
Python quickstat: Fix image links
  • Loading branch information
ntrogh authored Jan 18, 2024
2 parents 32cf423 + cc5ae13 commit 4aa915e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/python/python-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ MetaSocialImage: images/tutorial/social.png
The Python extension makes Visual Studio Code an excellent Python editor, works on any operating system, and is usable with a variety of Python interpreters.

Get started by installing:
- [VS Code](https://code.visualstudio.com/)
- [A Python Interpreter](/docs/python/python-tutorial.md#_install-a-python-interpreter) (any [actively supported Python version](https://devguide.python.org/#status-of-python-branches))
- [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) from the VS Code Marketplace

![Gif installing the Python extension in a fresh install of VS Code](/docs/python/images/quick-start/qs-python-ext-install.gif)
- [VS Code](https://code.visualstudio.com/)
- [A Python Interpreter](/docs/python/python-tutorial.md#_install-a-python-interpreter) (any [actively supported Python version](https://devguide.python.org/#status-of-python-branches))
- [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) from the VS Code Marketplace

![Gif installing the Python extension in a fresh install of VS Code](images/quick-start/qs-python-ext-install.gif)

To further customize VS Code for Python, you can leverage the [Python profile template](/docs/editor/profiles.md#python-profile-template), automatically installing recommended extensions and settings. For Data Science projects, consider using the [Data Science profile template](/docs/editor/profiles.md#data-science-profile-template).

![Gif showing the Python profile template being installing into VS Code.](/docs/python/images/quick-start/python-profile-create.gif)
![Gif showing the Python profile template being installing into VS Code.](images/quick-start/python-profile-create.gif)

## How to create and open a Python project or file

Expand All @@ -36,7 +37,7 @@ You can create a new Python file by selecting **New File** on the VS Code Welcom

When you launch VS Code for the very first time, you will need to install the Python extension to get Python-specific features and UI. Let’s look at the UI after installing the Python extension:

![Image of the Python UI highlights in VS Code.](/docs/python/images/quick-start/ui-tour.png)
![Image of the Python UI highlights in VS Code.](images/quick-start/ui-tour.png)

## Code Actions

Expand All @@ -48,7 +49,7 @@ Code Actions (also known as Quick Fixes) are provided to help fix issues when th

Python commands can be accessed through the [Command Palette](/docs/getstarted/userinterface.md#command-palette) (`kb(workbench.action.showCommands)`). From the Command Palette, you have access to various features from VS Code and installed extensions. Enter **“Python: “** in the Command Palette to find the commands available through the Python extension.

![Gif demonstrating how to access Python commands in the Command Palette.](/docs/python/images/quick-start/cmd-plt-v2.gif)
![Gif demonstrating how to access Python commands in the Command Palette.](images/quick-start/cmd-plt-v2.gif)

## Run, debug, and test

Expand All @@ -63,14 +64,15 @@ To run the Python script you have open on the editor, select the **Run Python Fi
![Image showing the Run Python File in Terminal play button.](images/tutorial/run-python-file-in-terminal-button.png)

There are also additional ways you can iteratively run snippets of your Python code within VS Code:
- Select one or more lines, then press `kbstyle(Shift+Enter)` or right-click and select **Run Selection/Line in Python Terminal**. This command is convenient for testing just a part of a file.
- From the Command Palette (`kb(workbench.action.showCommands)`), select the **Python: Start REPL** command to open a REPL terminal for the currently selected Python interpreter. In the REPL, you can then enter and run lines of code one at a time.

- Select one or more lines, then press `kbstyle(Shift+Enter)` or right-click and select **Run Selection/Line in Python Terminal**. This command is convenient for testing just a part of a file.
- From the Command Palette (`kb(workbench.action.showCommands)`), select the **Python: Start REPL** command to open a REPL terminal for the currently selected Python interpreter. In the REPL, you can then enter and run lines of code one at a time.

### Debug

The debugger is a helpful tool that allows you to inspect the flow of your code execution and more easily identify errors, as well as explore how your variables and data change as your program is run. You can start debugging by setting a breakpoint in your Python project by clicking in the gutter next to the line you wish to inspect.

![Screenshot showing a debugger breakpoint in a Python program.](/docs/python/images/quick-start/breakpoint.png)
![Screenshot showing a debugger breakpoint in a Python program.](images/quick-start/breakpoint.png)

To start debugging, initialize the debugger by pressing `kbstyle(F5)`. Since this is your first time debugging this file, a configuration menu will open allowing you to select the type of application you want to debug. If it's a Python script, you can select **Python File**.

Expand All @@ -81,13 +83,14 @@ Once your program reaches the breakpoint, it will stop and allow you to track da
For a deeper dive into Python debugging functionality, see [Python debugging in VS Code](/docs/python/debugging.md).

### Test

The Python extension provides robust testing support for [Unittest](https://docs.python.org/3.3/library/unittest.html) and [pytest](https://pytest.org/en/7.4.x/).

You can configure Python tests through the Testing view on the Activity Bar by selecting **Configure Python Tests** and selecting your test framework of choice.

You can also create tests for your Python project, which the Python extension will attempt to discover once your framework of choice is configured. The Python extension also allows you to run and debug your tests in the Testing view and inspect the test run output in the Test Results panel.

![Gif demonstrating test configuration, discovery, and run in the Python extension.](/docs/python/images/quick-start/qs-testing.gif)
![Gif demonstrating test configuration, discovery, and run in the Python extension.](images/quick-start/qs-testing.gif)

For a comprehensive look at testing functionality, see [Python testing in VS Code](/docs/python/testing.md).

Expand All @@ -107,6 +110,3 @@ There is much more to explore with Python in Visual Studio Code:
- [Debugging](/docs/python/debugging.md) - Learn to debug Python both locally and remotely.
- [Testing](/docs/python/testing.md) - Configure test environments and discover, run, and debug tests.
- [Settings reference](/docs/python/settings-reference.md) - Explore the full range of Python-related settings in VS Code.



0 comments on commit 4aa915e

Please sign in to comment.