Introduction
As developers, we all need a good IDE (Integrated Development Environment) to Code, Debug and execute programs. Visual Studio Code is one of the good IDE's which can be used for Python development. This article will discuss the following:
- Installing Python 3.7.3 (64 bit)
- Configuring Visual Studio Code IDE for Python development
- Code, Debug and Execute Python programs from Visual Studio Code
- Executing Python programs from the command line
- Executing Python programs using pyLauncher
Installing Python 3.7.3 (64 bit)
Visit here to download Python 3.7.3 executable (python-3.7.3-amd64.exe) to the local machine. By default, python-3.7.3-amd64.exe will get downloaded into the download folder.

Right-click on python-3.7.3-amd64.exe and select “Run as administrator”. It will display a dialog box.
Please ensure that we have selected the checkbox with the label “Add Python 3.7 to PATH”.
Once the checkbox is selected, please click on the “Install Now” link.
Please refer to the image below. It will display a dialog with the “Setup Progress” title and will take a couple of minutes to complete the installation.
Once the installation is done, it will display a dialog with the “Setup was successful” title.

We can give a quick glance inside the Control Panel, to verify the time stamp of the installation.

Also, we can verify that Python’s path as being added to the environment variables.

Please open a command prompt and type “python”, it will take us into REPL (Read Evaluate Print Loop).
We can see the python version is being displayed. Please refer to the image below.
Please type “print("\nHello Python 3.7.3")” at the prompt, it will print “Hello Python 3.7.3”. Type exit() to come output of Python REPL.

Configuring Visual Studio Code IDE for Python development
Open Visual Studio Code. Click on View -> Extensions menu option.

Inside the “Search Extensions” text field, please type “Python” to display the list of extensions for Python. Please select the Python extension from Microsoft and Install. This will enable the Python extension for Visual Studio Code.
Also, install VSCode-Icons from VSCode Icons Team.

Selecting the Python Interpreter
Inside Visual Studio Code, Click View -> Command Palette….

It will display the command palette. Inside the command palette type “Select Interpreter” and select “Python: Select Interpreter”.

It will display the list of available Python interpreter. Please select Python 3.7.3 64 bit.

Once the Python Interpreter is selected, we can see the visual indicator in the Visual Studio Code’s status bar. Please refer to the image below.

Install PyLint and AutoPep in Visual Studio Code
PyLint
Pylint is a Python static code analysis tool that looks for programming errors, helps to enforce a coding standard, sniffs for code smells and offers simple refactoring suggestions.
Autopep8
autopep8 automatically formats Python code to conform to the PEP8 style guide.
Inside Visual Studio Code, click on View -> Terminal menu option to display the terminal. Please type the below mentioned two commands to install PyLint and AutoPep packages.
- python.exe -m pip install -U pylint --user
- python.exe -m pip install -U autopep8 --user










Koshila SenadhiraPosted Dec 1, 2022, 11:19 AM
Interesting Article!