top of page
Search

How to Run Python in Visual studio code editor

To successfully run Python code in VS code. First, You need to set up Python development environment. To set up Python development environment, you must have installed VS code, Python Extension and Python itself on your computer.


How to run python in VS code
Image by Tutorial Brain

In this tutorial, we will learn "How to run Python in VS code" and we will do every necessary thing, which should be done. We will create python program and run that in VS code.


First of all, Download and Install Visual studio code editor. You can download VS code editor from their official website.


After downloading VS code editor on your computer. Now, you have to download Python and need to install on your computer. How can you do that? There is already a tutorial available on the website "How to Install Python on windows", You can read that too or you can watch video on our YouTube channel.


Open Visual studio code editor, You will see interface like this.


Visual studio code interface, VS code getting started

Look at the left side and Click on the Extensions icon or press "Ctrl + Shift + X". It will show side bar and in the side bar, you can see search bar on the top. Write "Python" in the search bar.


VS code Extensions

Click on the First extension and check whether this one made by Microsoft or not. You have to install Microsoft one.


Click on the install button and it will start installing the extension in your VS code. It would take some time in installing.


python's extension in visual studio code

After completing installation, Click close the them and Click on the File at the top-left corner. Click on New File below it and then Click on the Python file shown as in picture below.


python file creation in visual studio code

That will create a Python file, save that file where you want.


Now, Create your first Python program or write your first Python code.


python's first program in visual studio code, print function in python

Look at the top bar, Click on the Run and then Click on the Run without debugging or press Ctrl + F5. This will run your program.


run code in visual studio code

After running the code, a Terminal will open that will show you the result or output of your program as shown in picture below.


terminal, output, result, code output

This is how to run a Python program in VS Code in practice. If you’d like to see more programming tutorials, check out our YouTube channel, where we have plenty of video tutorials in English.



bottom of page