This document is shared with Huawei Cloud community Visual Studio Code Organizing and Formatting by Yuchuan.

All languages in Visual Studio Code can be formatted using one of the automatic formatters, and the Python extension also supports Linter.

Organize and format

Linter and formatter perform different tasks:

  • A formatting will change what your code looks like rather than how it works.
  • A staple will warn you of standard style, type compliance, security, and a set of best practices for your code.

Python extensions support many third-party linters, which often perform different jobs. For example, Bandit is a Linter for security vulnerabilities, while Flake8 is a Linter for style guide compliance.

The Python extension also comes with the language server tool, which performs analysis by loading interfaces (methods, functions, classes) from your code and the libraries you use.

At the time of writing this tutorial, the latest and greatest language server extension for Python on Visual Studio Code is Pylance.

Set the Pylance

Pylance is an extension that works with Python in Visual Studio Code to provide deeper language support and introspection of Python Code. Pylance will offer auto-completion, auto-module import, better code navigation, type checking, and much more.

To get Pylance, go to the “* Extensions” menu on the sidebar and search for Pylance(ms-python.vscode-pylance).

Note: Pylance now comes bundled with the Python extension, so you may already have it installed.

After installing Pylance, you may need to change two default configuration Settings in user Settings to take full advantage of the extension.

The first setting to change is type checking mode, which you can use to specify the level of type checking analysis to perform:

"python.analysis.typeCheckingMode": "basic"
Copy the code

By default, type checking mode is set to “off”.

The other options are “basic” or “strict”. Use “Basic” to run rules unrelated to type checking and rules for basic type checking. If mode is set to “strict”, it runs all type checking rules with the highest error severity. Set this setting “Basic” to strike a balance between strict and disabled.

Another default is python. Analysis. DiagnosticMode. By default, Pylance will only check the currently open file. Changing this setting to workspace checks all Python files in the workspace, giving you a list of errors and warnings in the Explorer view:

Only when you have some RAM available to python should be set up. The analysis. DiagnosticMode as “workspace”, because it will consume more resources.

Pylance is most effective when it has information about the types of parameters used as methods and functions and the types of returns.

For external libraries, Pylance uses typeshed to infer return types and parameter types. Pylance also provides type stubs and intelligence for some of the most popular data science libraries, such as Pandas, Matplotlib, SciKit-Learn, and NumPy. If you are using Pandas, Pylance provides you with information and examples of common features and patterns:

For libraries that don’t have type stubs on typeshed, Pylance does his best to guess what type is. Otherwise, you can add your own type stubs.

Set formatting and Lint at save time

Formatting a document is the operation of applying formatting to any document in VS Code. For Python extension, this action execution “Python. Formatting. The provider”, it can be set to any support automatic formatting: “autopep8”, “black” or “yapf”.

After configuring the formatter in Settings. json, you can set the formatter to run automatically when the file is saved. In VS Code configuration, you can configure the editor Settings to apply only to certain file types by placing them in a “[

]” group:

. "[python]": { "editor.formatOnSave": true, },Copy the code

As the formatter executes, you can also organize import statements alphabetically and by grouping standard library modules, external modules, and package imports into groups with the following configuration:

"[python]": {
    ...
    "editor.codeActionsOnSave": {"source.organizeImports": true},
},
Copy the code

Unlike formatting, linting is specific to Python extensions. To enable linting, Select a Linter by running Python: Select Linter on the command panel. You can also enable one or more Linters in your Settings. For example, to enable Bandit and Pylint linters, edit your settings.json:

. "python.linting.enabled": true, "python.linting.banditEnabled": true, "python.linting.pylintEnabled": true,Copy the code

To run linter enabled when saving the file, add the following Settings to settings.json:

. "python.linting.lintOnSave": true,Copy the code

You may find it helpful to enable multiple Linters. Keep in mind that Pylance already provides many of the insights you can get from PyLint, so you probably don’t need to enable Both PyLint and Pylance. Flake8, by contrast, provides stylistic feedback that Pylance does not cover, so you can use both in combination.

Test Python Code in Visual Studio Code

Python provides a number of tools to test your code. VS Code’s Python extension supports the most popular testing frameworks, UnitTest and PyTest.

Configuration test integration

To enable testing support for Python, run Python: Configure Tests from the command panel. VS Code will prompt you to choose from one of the supported testing frameworks and specify the folder that contains your tests.

This wizard adds configuration options to.vscode/settings.json:

"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
    "tests"
],
Copy the code

You can edit python.testing.

Args using the preferred testing framework to add any other command line flags. The above example shows the configuration options for PyTest.

If you have more complex PyTest Settings, put them in PyTest.ini instead of VS Code Settings. This way, you can keep the configuration consistent with any automated testing or CI/CD tool.

Perform the test

After configuring the test framework and parameters for the test runner, you can Run commands from the command panel using Python: Run All Tests. This starts the test runner with the configured parameters and places the test output in the Python test log output panel:

After test discovery is complete, each test case will have an inline option to execute or debug the use case:

Failed tests are marked as having errors. You can be inPython test logView test runner failures in the panel and by hovering over failed test cases in code:

If you run tests frequently, you can use the Testing Explorer to improve the testing experience in VS Code.

To enable the Tests panel, right-click the sidebar and make sure tests are selected. The Tests panel shows all the tests found by the Python extension and gives you a lot of functionality:

You can visually represent test suite groups and which tests fail. You can also run and debug tests using menu buttons.

VS Code’s test system is powerful, but many features are disabled by default to make it a lightweight editor. In addition to testing, you may want to run other tasks from within VS Code on a regular basis. This is where the mission system comes in.

Use Visual Studio Code task system

Visual Studio Code supports compiled languages like Go, Rust, and C++, as well as interpreted languages like Python and Ruby. VS Code has a flexible system to perform user-defined configuration tasks, such as building and compiling Code.

Python code usually doesn’t need to be compiled ahead of time, because the Python interpreter does it for you. Instead, you can use the task system to pre-configure the tasks you will run on the command line, such as:

  • Build wheels or source code distribution
  • Run tasks in frameworks like Django
  • Compile Python C extensions

VS Code tasks are commands or executable files that can be run on demand using the command palette. There are two built-in default tasks:

  1. In the build task
  2. The test task

Note that you can use tasks for anything that might be executed from the command line. You are not limited to build and test activities.

Compile wheels using tasks

If you have a setup.py file to build packages to distribute on PyPI, you can use the task system to automatically build source (Python) and binary (compiled Python) distributions.

The tasks are defined in the.vscode/tasks.json file. To try it out, create.vscode/tasks.json and copy this configuration:

1 {2 "version" : "2.0.0", 3 "tasks" : [4 {5 "type" : "shell", 6 "command" : "${command:python.interpreterPath}", 7 "args": ["setup.py", "bdist_wheel", "sdist"], 8 "isBackground": true, 9 "options": {"cwd": "${workspaceFolder}"}, 10 "label": "Build Wheel", 11 "group": { 12 "kind": "build", 13 "isDefault": true 14 } 15 } 16 ] 17}Copy the code

There are a few things to note in this example, so you’ll look at the most important configurations line by line:

  • ** Line 5: ** Task type isshell, which specifies that this should run under the shell you configured.
  • ** Line 6: the ** command is${command:python.interpreterPath}, which is a built-in variable in the Python interpreter for this environment. This includes any active virtual environment.
  • ** Line 9: ** this option"options": {"cwd": "${workspaceFolder}"}Specifies that this should run under the root of the project. You can change it to a subfolder if desired.
  • ** Line 11 ~ 13: ** will"group"Is set to"build"And this task will become the default job as you set it"isDefault"totrue. This means that this task will run as the default build task.

To perform the default Build Task, you can Run Tasks: Run Build Task from the command panel or use the built-in keyboard shortcut Cmd+F9 or Ctrl+F9. Under the “* Terminal” * TAB, you can find the output of the build command, whose output name is whatever you specify “label” :

You are not limited to build scripts. The task system is a good solution to Django and Flask management commands.

Using Django Tasks

Are you using a Django application and want manage.py to run automatically from the command line? You can create tasks using shell types. This way, you can execute manage.py using the Django subcommand you want to run along with any parameters:

{" version ":" 2.0.0 ", "tasks" : [{" type ":" shell ", "command" : "${command: python. InterpreterPath}", "args" : ["manage.py", "makemigrations"], "isBackground": true, "options": {"cwd": "${workspaceFolder}"}, "label": "Make Migrations" } ] }Copy the code

To Run this Task, use the commands in the Tasks: Run Task command panel and select the Make Migrations Task from the list.

You can copy this code snippet and paste it into any Django command you run periodically, such as CollectStatic.

Link to the task

If you have multiple tasks that should be run sequentially or one task depends on another, you can do it in tasks.json.

In the setup.py example on the extension, if you want to setup your own package source distribution first, you can add the following tasks.json:

. { "type": "shell", "command": "${command:python.interpreterPath}", "args": ["setup.py", "sdist"], "isBackground": true, "options": {"cwd": "${workspaceFolder}"}, "label": "Build Source", }Copy the code

In the default build task, you can add an attribute dependsOn and a list of task tags to run first:

{" version ":" 2.0.0 ", "tasks" : [{" type ":" shell ", "command" : "${command: python. InterpreterPath}", "args" : ["setup.py", "bdist_wheel"], "isBackground": true, "options": {"cwd": "${workspaceFolder}"}, "label": "Build Wheel", "group": { "kind": "build", "isDefault": true }, "dependsOn": ["Build Source"] } ] }Copy the code

The next time you run this task, it will run all related tasks first.

If you have multiple tasks that this task depends on and they can run in parallel, please add “dependsOrder”: “Parallel” to the task configuration.

Run Tox using tasks

Now you’ll explore Tox, a tool designed to automate and standardize Python tests. Visual Studio Code’s Python extension does not come with tox integration. Instead, you can use the task system to set tox as the default test task.

** If you want to start with TOX quickly, then install TOX and PIP and run the tox-quickstart command:

$ python -m pip install tox
$ tox-quickstart
Copy the code

This will prompt you to complete the steps to create the Tox profile.

To automatically run tox with your tox configuration, add the following tasks to tasks.json:

{
  "type": "shell",
  "command": "tox",
  "args": [],
  "isBackground": false,
  "options": {"cwd": "${workspaceFolder}"},
  "label": "Run tox",
  "group": {
      "kind": "test",
      "isDefault": true
  }
}
Copy the code

You can Run this Task using the Tasks: Run Test Task command panel, which will use the output in the terminal TAB to perform tox:

If you have several tasks and need to run them frequently, it’s time to explore a great extension that adds shortcuts to the UI for running configuration tasks.

Use the task Explorer extension

The task Browser extension (spmeesseman. Vscode – TaskExplorer) adds simple user interface controls to run your pre-configured tasks. After installation, the task Explorer becomes a panel in the Explorer view. It scans your project automatically for tasks found by NPM, make, gulp, and many other build tools. You can find your task under vscode group:

Click the arrow next to any task to execute it, and if you change the configuration of the task, click the refresh icon at the top.

Debug Python scripts in Visual Studio Code

Visual Studio Code’s Python extension comes bundled with a powerful debugger that supports both local and remote debugging.

The easiest way to run and debug simple Python scripts is to go to the Run → Start Debugging menu and select the Python file from the selection. This will execute the current file using the configured Python interpreter.

You can set breakpoints anywhere in the code by clicking the binding line to the left of the line number. When code execution hits a breakpoint, the code pauses and waits for instructions:

The debugger adds a menu of controls:Continue,Step Over,Step Into,Step Out,RestartandStop Execution:

On the left panel, you can perform common debugging operations, such as exploring local and global variables and Python’s call stack. You can also set up the watch, which you’ll learn more about in the next section.

Set a watch

Monitoring is an expression that persists between debug sessions. When you stop execution and start debugging again, you retain all monitoring from the last session.

You can add variables to Concerns from panel variables by right-clicking on a variable and then selecting Panel Add to Concerns.

You can also add any Python expression to the monitor * list by clicking the *+ icon. Expressions can contain:

  • Small Python expressions, for examplex == 3
  • Function calls, for examplevar.upper()
  • To compare

Whenever you hit a breakpoint, you get the current result of each expression in real time. VS Code will also update the values for each watch as you step through the session:

You can use the arrow on the left to extend complex types such as dictionaries and objects.

So far, you’ve seen the debugger for a single Python file, but many Python applications are modules or require special commands to start.

Configuring the startup File

VS Code has a configuration file for launching configuration files. VS Code’s Python debugger can launch any startup configuration and attach the debugger to it.

** Note: ** To see the expected results of your upcoming configuration, you need to set up a valid FastAPI project and install the asynchronous Web server Uvicorn in your Python environment.

As an example of using startup profiles in VS Code, you’ll explore how to launch FastAPI applications using the ASGI server Uvicorn. In general, you might just use the command line:

$ python -m uvicorn example_app.main:app
Copy the code

Instead, you can set the equivalent launch configuration launch.json in the following location:

{
  "configurations": [
    {
      "name": "Python: FastAPI",
      "type": "python",
      "request": "launch",
      "module": "uvicorn",
      "cwd": "${workspaceFolder}",
      "args": [
          "example_app.main:app"
      ],
    }
  ]
}
Copy the code

Here, you set the “type” configuration to “Python”, which tells VS Code to use the Python debugger. You also set “module” to specify the Python module to run, in this case “uvicorn”. You can supply any number of arguments “args” below. If your application requires environment variables, you can also set them using the env argument.

After adding this configuration, you should find a new startup configuration ready to start under the “* Run and debug” * panel:

When you press F5 or select Run → Start Debugging from the top menu, anything that you configured for the first startup configuration will Run.

If VS Code does not automatically select the correct Python environment for you, then you can also declare an explicit path to the appropriate Python interpreter in your.vscode/launch.json file as an option:

 1{
 2  "configurations": [
 3    {
 4      "name": "Python: FastAPI",
 5      "type": "python",
 6      "python": "${workspaceFolder}/venv/bin/python",
 7      "request": "launch",
 8      "module": "uvicorn",
 9      "cwd": "${workspaceFolder}",
10      "args": [
11          "example_app.main:app"
12      ],
13    }
14  ]
15}
Copy the code

You can add the path to the Python interpreter as a new entry named “Python”. In this example, the interpreter is located in the Venv Python virtual environment that you created at the root of the workspace folder. If you want to use a different Python interpreter, you can define its path to suit your Settings by editing the path shown in line 6.

Master remote development

VS Code supports three types of remote development profiles:

  1. The container
  2. Remote host over SSH
  3. Windows Subsystem for Linux (WSL)

All three options are provided by the remote development extensionpack (ms-vscode-remote.vscode-remote-extensionpack). You need to install this extension pack to show remote debugging in VS Code.

Use containers for remote development

You need to install the Docker runtime on your machine to debug containers remotely. If you haven’t already installed Docker, you can download it from the Docker website.

When Docker is running, go to the Remote Explorer TAB on the navigation menu on the left. Change the Remote Explorer drop-down menu to Containers and you will see a view with panels:

If you have a brand new Docker installation, these panels will not be filled.

If you have the Docker image installed and running, three panels may fill:

  1. **Containers: ** A navigation panel that displays links to development Containers or some quick start steps in this workspace
  2. ** The name of the container (if running) : ** The properties and volume installation of the running container
  3. **DevVolumes: ** A list of development volumes you can edit and mount to modify your code

For example, if you have installed the trial development container: Python following the steps outlined in VS Code’s Container tutorial, your VS Code Remote Explorer TAB will display the name of the running container in the previously mentioned panel:

Use these panels to quickly manage any Docker containers that your project depends on.

In general, there are three main ways to run remote container extensions:

  1. Attach to an existing run container for quick changes
  2. create.devcontainer/devcontainer.jsonFile and open the workspace as a remote container
  3. runRemote-Containers: Reopen in ContainerCommand and select the Python 3 image

. Devcontainer/devcontainer. Json compared to simply open the container, create a file has significant advantage:

  • The development container supports the GitHub code space
  • The development container supports the startup profile and task configuration shown in this tutorial

If you plan to do a lot of work in containers and VS Code, the extra time spent creating development containers will be well worth it.

** Note: ** You can learn more about how to create development containers by reading the official VS Code documentation.

A quick way to get started with a development container is to create it from your current workspace:

  1. Remote-Containers: Reopen in ContainerRun commands from the command panel.
  2. Select Python 3, and then select the version of Python you want.
  3. Accept the default recommended version of Node.js.

Then VS Code will transplant your workspace and existing. Devcontainer/devcontainer json DockerfilePython based generic create configuration.

The development container has two required files:

  1. . Devcontainer/devcontainer. Json, it specifies all VS Code requirements, such as the need which extensions and what Settings to use
  2. Dockerfile, which specifies which commands will build the environment

In default Settings, Dockerfile is located in the. Devcontainer/directory. If your project has been a Dockerfile, you can change it. Devcontainer/devcontainer json.

You will use the default values. Devcontainer/devcontainer json to specify:

  • theThe paththeDockerfile
  • Container name
  • VS Code Settings to apply
  • Any VS Code extensions that need to be installed
  • After any creation you want to runThe commandpython -m pip install <package>, for instance,

If your applications need other packages from PyPI, please change. Devcontainer/devcontainer json and uncomment line designated “postCreateCommand” :

{... // Use 'postCreateCommand' to run commands after the Container is created. "postCreateCommand": "python3 -m pip install -r requirements.txt", }Copy the code

If you are developing applications that provide network services, such as Web applications, you can also add port forwarding options. For a complete list of options, you can see the devContainer.json reference.

After making changes to the Dockerfile or DevContainer specification, Rebuild the Container from the remote Explorer by right-clicking the running Container and selecting Rebuild Container:

By doing so, you will use both the configuration and Dockerfile.

In addition to the extended capabilities of the Remote Development extension pack for remote debugging, there is also a Docker extension for VS Code. You’ll cover this extension and find out more at the end of this tutorial.

Use SSH for remote development

Run remote-ssh: Open SSH Configuration File in the command panel to Open the local SSH Configuration File. This is a standard SSH configuration file that lists the host, port, and private key paths. The default IdentityFile option is ~/.ssh/id_rsa, so the best way to authenticate is with a private and public key pair.

Here is a sample configuration for two hosts:

Host 192.168.86.30
  HostName 192.168.86.30
  User development
  IdentityFile ~/path/to/rsa

Host Test-Box
  HostName localhost
  User vagrant
  Port 2222
Copy the code

After saving the configuration file, the Remote Explorer TAB will list these SSH hosts under the SSH Target drop-down:

To connect to this server, click Connect to Host in A New Window, which is the icon on the right of any host. This will open a new VS Code window with a remote host.

Once connected, click open folder in the Explorer view. VS Code will display a special folder navigation menu that shows the folders available on the remote host. Navigate to the folder where your code resides, where you can launch a new workspace:

In this remote workspace, you can edit and save any file on the remote server. If you need to run any other commands, the * Terminal * TAB is automatically set as the SSH terminal for the remote host.

Use WSL for remote development

The Windows Subsystem for Linux, or WSL, is a component of Microsoft Windows that enables users to run any number of Linux distributions on their Windows operating system without the need for a separate hypervisor.

VS Code supports WSL as a remote target, so you can run VS Code under WSL for Windows and develop for Linux.

To use WSL in VS Code, you first need to install WSL. After installing WSL, you need to have at least one distribution available.

The easiest way to install WSL on the latest version of Windows 10 is to open a command prompt and run:

C:\> wsl --install
Copy the code

The –install command does the following:

  • Enable optional WSL and virtual machine platform components
  • Download and install the latest Linux kernel
  • Set WSL 2 to the default
  • To download and install the Linux distribution, you may need to reboot your machine

After successfully setting up WSL on your computer, you will also need to install the remote-WSL (MS-VScode-remote.remote-WSL) extension for VS Code. After that, you can use WSL in Visual Studio Code.

If you already have Code in WSL, run remote-WSL: Open Folder in WSL from the command panel in VS Code. Select the target directory for your code in the Linux subsystem.

If your code has been checked out in Windows, remote-WSL: Reopen Folder in WSL is run from the command panel.

The remote Explorer remembers the WSL targets you configured and lets you quickly reopen them from the WSL targets drop-down menu in the remote Explorer view:

If you want a reproducible environment, consider creating a Dockerfile instead of working directly on the WSL host.

Use data science tools

VS Code is ideal for application development and Web development using Python. It also has a powerful set of extensions and tools for handling data science projects.

So far, you’ve mainly covered VS Code’s Python extensions. There is also the Notebooks expansion of Jupyter, which integrates the IPython kernel and notebook editor into VS Code.

Install the Jupyter Notebook extension

To begin using The Notebooks of Jupyter on VS Code, you need the MS-Toolsai.jupyter extension.

Note: Jupyter Notebooks support is now bundled with Python extensions, so don’t be surprised if you’ve already installed it.

Notebooks of Jupyter supports PIP as a package manager, and Conda from the Anaconda release.

Python’s data science libraries typically require compilation modules written in C and C++. Conda If you use a lot of third-party packages, you should use them as a package manager because the Anaconda distribution has resolved build dependencies on your behalf, making it easier to install packages.

We started using Jupyter Notebook in VS Code

In this case, you will open a series of Notebooks of Jupyter about wave transforms. Download the repo’s.zip/ folder and unzip it, or clone the GitHub repo and open it with VS Code. The steps further described also apply to any other workspace that contains.ipynb notebook files.

** Note: ** The rest of this section uses the Conda package manager. To use the commands shown in this section, you need to install Anaconda.

In VS Code, you can use any existing Conda environment. Instead of installing packages into the base environment, you can conda create a specialized environment for VS Code from the terminal:

$conda create --name vscode python=3.8Copy the code

After creating the conda named environment with vscode, you can install some common dependencies in it:

$ conda install -n vscode -y numpy scipy pandas matplotlib ipython ipykernel ipympl
Copy the code

After installing the dependencies, Python: Select Interpreter runs the command from the VS Code command panel and searches VS Code to Select the new Conda environment:

This selection sets your VS Code to use the Python interpreter in your Conda environment, VS Code.

** Note: ** If the Conda environment is not available in the list, you may need to run commands from the command panel through Developer: Reload Window to Reload the Window.

After selecting, open the Notebook in VS Code and click the Select Kernel button or Notebook: Select Notebook Kernel to the right to run commands from the command panel. Type vscode to select the newly created environment where conda has dependencies installed:

Selecting the new Conda environment as the kernel for your laptop will give your laptop access to all the dependencies you installed in that environment. This is required to execute the code unit.

After selecting the kernel, you can run any or all of the cells and see the action output displayed in VS Code:

After notebook execution, the Jupyter extension will be inJupyter: VariablesAny intermediate variables, such as lists, NumPy arrays, and Pandas, are provided in the viewDataFrames:

You can bring this View into Focus by clicking the “* Variables” * button at the top of the notebook or by running the Jupyter: Focus on Variables View command.

For more complex variables, select the icon to open the data in the data viewer.

Use the data viewer

The Jupyter extension comes with a data viewer for viewing and filtering 2D arrays such as lists, NumPyndarray, and Pandas DataFrames:

To access the data viewer, you can clickDisplay variables in the data viewerTo expand complex variables in the variables view. This option is indicated by the icon displayed to the left of the line representing complex variables:

The data viewer supports inline filtering and paging of large data sets. If you are drawing large data sets in Matplotlib, the Jupyter extension supports Matplotlib widgets instead of SVG rendering.

Use Rainbow CSV extensions

If you use CSV or TSV to enter data, there is a useful extension called Rainbow CSV (mechatroner. Rainbow – CSV) that enables you to open and visualize CSV files in VS Code:

Each column is colored, allowing you to quickly find missing commas. You can also run commands from the command panel to Align all Columns with Rainbow CSV: Align CSV Columns.

** Note: ** If you are looking for a sample CSV file to try out this extension, you can select a CSV file to download from the Official Statistics page of the New Zealand Government.

The Rainbow CSV extension also comes with the Rainbow Query Language (RBQL) Query tool, which lets you write RBQL queries against CSV data to create filtered datasets:

You can access the RBQL console by running Rainbow CSV: RBQL in the command panel. After executing the query, you will see the result in a new TAB as a temporary CSV file that you can save and use for further data analysis work.

In this tutorial, you have installed several useful extensions for VS Code. There are many useful extensions available. In the final part of this tutorial, you’ll learn about some additional extensions that haven’t been covered so far that you might want to try out.

Add bonus extensions to Visual Studio Code

There are thousands of extensions to the VS code market. The choice of extensions covers everything from language support, themes, spell checking, and even mini-games.

So far in this tutorial, you’ve introduced a number of extensions that make Python development in Visual Studio Code more powerful. The last four extensions are optional, but can make your life easier.

Code spell checker

Code Spell checker (Streetsidesoftware.code-spell-checker) is a spell checker that checks variable names, text in strings, and Python docstrings:

The code spell checker extension will highlight any suspected spelling errors. You can correct spelling in the dictionary or add words to the user or workspace dictionary.

The Workspace dictionary will be in the workspace folder, so you can check it in to Git. The user dictionary remains the same in all of your projects. If you have a lot of keywords and phrases that you use frequently, you can add them to the user dictionary.

The dockers

The Docking extension (MS-azureTools.vs code-docker) makes it easy to create, manage, and debug containerized applications:

The Docker extension goes beyond the remote-Containers extension you introduced earlier. It provides you with a UI to manage images, networks, container registries, volumes, and containers.

Thunderbolt client

Thunder Client (rangav.vscode-thunder- Client) is VS Code’s HTTP Client and UI designed to help test REST apis. If you’re developing and testing apis in frameworks like Flask, FastAPI, or Django Rest Framework, you’ve probably used tools like Postman or Curl to test your applications.

In Thunder Client, you can create HTTP requests and send them to your API, action headers, and set text, XML, and JSON payloads:

Thunder Client is a great alternative to Postman or Curl because you can use it directly in VS Code, so you can avoid switching between applications when testing and developing REST apis.

VS Code Pets

VS Code Pets (Tonybaloney. Vscode-pets) is an interesting extension that can place one or more small Pets in your VS Code window:

You can customize PETS, customize their environments, and play games with them.

** Note: ** As the author of this tutorial, I would say this is a great extension — but I might be biased because I created it.

This is just a snapshot of the expansion on the market. There are thousands of other language support, UI improvements, and even Spotify integration to discover.

conclusion

Visual Studio Code’s Python tools are growing rapidly, and the team releases monthly updates with bug fixes and new features. Be sure to install any new updates to keep your environment up to date and at its best.

In this tutorial, you’ve seen an overview of some of the more advanced features in Visual Studio Code, the Python and Jupyter extensions, and some additional extensions.

You learned how to:

  • Customize your user interface with smooth UI customization and keyboard bindings
  • Run and monitor Python tests by integrating the test framework into Visual Studio Code
  • Clean up and format code using Pylance and external Linters
  • Debug local and remote environments via SSH and Docker****
  • Start data science tools to use The Notebooks of Jupyter

You can use this knowledge to put yourself on track to become an advanced VS Code user.

Try some of these extensions and test them out as you work on your next project. You may find that some VS Code features are more useful to you than others. Once you know about some customizations and extensions, you may find yourself searching the VS Code documentation for more and even writing your own extensions!

Click to follow, the first time to learn about Huawei cloud fresh technology ~