HOW TO INSTALL AND CONFIGURE VISUAL STUDIO FOR PYTHON

In this blog, we will see about the step by step process of installation of visual studio code and add the python extension to them. Visual studio code is an light weight ,open source and extensible editor available for all platforms.

Below are the steps required to complete the installation and configure of visual studio code with python,

  1. Install Visual Studio code
  2. Install Python Interpreter
  3. Install Python Extension for VS  code

INSTALL VISUAL STUDIO CODE:

  1. Download visual studio code from VS code website.
  2. Choose the download the VS code editor for your operating system. Here we are going to see for Windows.
  3. Double click to install the downloaded setup.exe file.

ii)   Click Next on the setup dialog box. Choose the install folder for the VS code and click Next.

In the next dialog, check create desktop icon for easy access of the tool. Select Next and Install.

After proper install of VS code, the VS code editor will open with home screen.

INSTALL OF PYTHON INTERPRETER

  1. Download Python from Python.org. The latest version of python will be available on the home page and you can directly download the same.
  2. Open the pythonsetup.exe file and select install now option.
  1. Select Yes on the User account control dialog prompted to install python.
  2. To verify if python was successfully installed, put the command to check the version of the python in the command prompt or terminal window.

Windows:                 py -3 –version

Linus/MAC OS:        python3 version

INSTALL PYTHON EXTENSION FOR VS CODE:

  1. Download the python extension from VS CODE Marketplace. Once the extension is selected for install , it will prompt to VS code.
  2. Select Install option on the extension page opened on VS code editor.

After install of python extension, the python interpreter should be chosen to run the python programs. For that select settings->Command Palette and type (Python:Select Interpreter).Choose the python Interpreter installed in previous step.

Now you are ready to start code on python programs.

LETS WRITE A SIMPLE PYTHON PROGRAM TO VERIFY THE INSTALLATION

  1. Create a new python file(hello.py) on the workspace folder.  A new python file will be opened.
  2. After writing the code snipped select run option on the top right corner.