Visual Studio Code For Python Development

Visual Studio Code (VS Code) is a popular and versatile code editor that supports Python development through various extensions and features.


Visual Studio Code Installation for Python

  • Go to https://code.visualstudio.com/download url and download the Visual Studio Code according your operating system.

  • Wait until the download complete.

  • Double-click on the downloaded file (For Windows user)

  • Go ahead the installation process according to setup wizard.


Visual Studio Code Extension for Python

Visual Studio Code Extension refers to a software module or add-on that extends the functionality of Visual Studio Code (VS Code).


VS Code Extension Installation

  • Open the VS Code

  • From Left Panel click on Extensions or from keyboard press CTRL + SHIFT + X

  • Search the extension name

  • Click on the extension and click to Install from right panel.


Python

The Python extension for Visual Studio Code is a powerful tool that enhances the development experience for Python programmers. It is developed by Microsoft and provides a range of features to support Python development.


VS Code Create Python Virtual Environment

  • For details about virtual environment follow the link of Details of Virtual Environment.

  • Open the Visual Studio Code IDE

  • Open the search or press from keyboard CTRL + SHIFT + P

  • Write the text Python: Create Environment

  • From the list select Venv Creates a .venv. Press Enter

  • Select the Global Interpreter path, Press Enter

  • Wait a bit and it will create a .venv directory

  • It will automatically activate on run.


Visual Studio Code Format & Lint

  • Code formatting refers to the process of structuring and styling source code in a consistent and standardized manner.

  • Code linting is the process of analyzing source code to find and flag programming errors, bugs, and stylistic issues without executing the code.