Visual Studio Code
Source: Visual Studio Code
Cloud VS Code 🆕
Setup VS Code - portable installation
Download the zip file for the preferred version from https://code.visualstudio.com/download
Decompress the zip file to the target directory; the vs code root directory may look like,
VSCode-win32-x64-1.73.1
Create a
data
folder inside the vs code root directory. Thedata
folder will be used to store theextensions
and the user dataNote: auto update does not work with the portable version. So, to update the portable version perform the above steps, and then copy the
data
folder to the new version root folder.
Setup Python development environment
Install the Python extension for VS Code from the Visual Studio Marketplace
Select a Python interpreter; from within VS Code, open the Command Palette (Ctrl+Shift+P), start typing the Python: Select Interpreter command to search, then select the command.
Create Virtual Environment
Prerequisite: Python and
virtualenv
package have been installedFrom the vs code terminal, run
virtualenv .venv
After the virtual environment is created, vs code should prompt to set it as the default for your workspace folder. If selected, the environment will automatically be activated when you open a new terminal. If not prompted, select your new environment by using the Python: Select Interpreter command from the Command Palette. Select
Python 3.*.* ('.venv': venv) .\.venv\Scripts\python.exe
Customizations
Set the default terminal to "command prompt" - open the command palette and search for "Terminal: Select Default Profile"), and select the preferred shell
Pylance offers auto import suggestions for modules in your workspace and/or packages you have installed in your environment. This enables import statements to be automatically added as you type. Auto imports are disabled by default, but you can enable them by setting
python.analysis.autoImportCompletions
totrue
in your settings.The python environment file
.env
in the current workspace folder. The file is identified by the default entry"python.envFile": "${workspaceFolder}/.env"
in the user settingsBlack formatter. Installed and enable Black as the default formatter in the vscode settings:
editor.defaultFormatter
Customization References:
Working with Git Source Control
Source: Using Git source control in VS Code
Connect to WSL folder
See Windows WSL
Also see this article but may not be very accurate
Last updated