How to Set Up VSCode for Python Programming in Windows

Ajay Choudhury 04 Aug, 2021 3 mins
How to Set Up VSCode for Python Programming in Windows

VS Code is one of the best and advanced texts and source-code editor software in the market which is available for Windows, macOS and Linux. VS Code is developed actively by Microsoft and it is a free-to-use software. It supports almost all programming languages with the help of some lightweight plugins developed either by Microsoft or by some other developers. It basically aims to replace different source code editors for different languages and provides a unified place to code with all languages at a time.

We prefer using VSCode for features like:

  • Lightweight Installation.
  • Support for debugging.
  • Syntax highlighting.
  • Intelligent code completion.
  • Pre-built code snippets.
  • Code refactoring.
  • Embedded Git and more.

You can easily download the plugins from the ‘Extensions Marketplace’ integrated within VS Code. With all these features, there are tons of other shortcuts and plugins which can effectively boost up your coding speed and accuracy.

Now, as you are introduced to the VS Code in brief, it is enough for you to begin using the awesome source code editor by Microsoft. As you begin using the VS Code, you will automatically discover all the awesome features and shortcuts it comes with.

Set Up VS Code for Python Programming

Python is one of the most advanced and easy-to-learn languages. Its syntax is very natural looking and it is a beginner-friendly language. You can browse our notes on complete notes on Python. This is the first module of our Python notes and in this module, we will see how to set up the environment for Python programming.

Step 1: Download VS Code from the Official Site

Download VSCode

It is very crucial to download the software from its official site. In this way you receive the latest version of the software and also it ensures that the software is clean and safe to use.

Step 2: Download the latest Python Interpreter

Download Python

VS Code is a universal platform for editing all kinds of source codes. It extends its functionalities with plugins, interpreters and compilers. Hence, you will need to download the Python interpreter from the official site of Python.

Step 3: Install the Python Interpreter

Install Python step-by-step

There is a small mistake that can create a fuss when you prepare yourself for coding in python if you don’t address it while installing the Python. Make sure you check the option showing add the Python interpreter to the PATH, as shown in the above image.

Step 4: Install VS Code

Install VSCode

Similar to the installation of the Python interpreter, while installing the VS Code, make sure you check all the fields as shown in the image above. This will not only set the VS Code up for Python but also for other programming languages like C and C++.

Step 5: Install the Python extension in VS Code

Install Python Extension

Inside the VS Code, move to the Extensions Marketplace and download the official plugin for Python by Microsoft only. It will extend the functionality of the Python interpreter within the VS Code.

Step 6: Open a folder and start coding

Open folder and start coding

Now everything is set up for Python programming. Just open a folder or workspace in which you want to store all your programs/codes and create a .py file and paste the code given below (basic Hello World code) and run it to check if the environment is set up correctly. It should return Hello World! as output in the terminal. (on terminal run it by writing py your_file_name)

# This is a simple Python program
print('Hello World!')

Bonus Tip: Enable the ‘AutoSave’ option in the Files menu. It really helps, many times when you are working on some sort of program you might face irritating errors because you had forgotten to save the code.

If you are new to Python, then there are tons of intuitive resources available on the internet which can help you learn basic Python programming from scratch. A few of them are CodewithHarry’s Python Playlist on YouTube and W3 Schools Python Guide.

Hope the guide helps. Feel free to put your suggestions, queries and comments below.

Was this Article Helpful?

Ajay Choudhury

Ajay Choudhury

A learner and a student of technlogy. He loves sharing experiences and learning with others through his projects and blog. Along with technology, he loves playing football and enjoys listening to music and podcasts.



Contribute to make this site more awesome →