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. The data folder will be used to store the extensions and the user data

  • Note: 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

Create Virtual Environment

  • Prerequisite: Python and virtualenv package have been installed

  • From 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 to true 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 settings

  • Black formatter. Installed and enable Black as the default formatter in the vscode settings: editor.defaultFormatter

Working with Git Source Control

Source: Using Git source control in VS Code

Connect to WSL folder

Last updated