How to Run Python Code in Visual Studio Code(VS Code)

Using this article, you can implement this How to Run Python Code in Visual Studio Code(VS Code) here. We will start the discussion below to successfully implement this task.

Python is one of the most popular and easy-to-learn languages, which is why it is often one of the first languages you learn. Let’s see how to work with and run Python inside of Visual Studio Code.

A configuration drives VS Code’s behavior during a debugging session. Configurations are defined in a launch.json file that’s stored in a .vscode folder in your workspace.

How to Run Python Code in Visual Studio Code(VS Code)

Run Python Code in Visual Studio Code(VS Code)

Requirements:-

  • Visual Studio Code
  • Python
  • In Visual Studio, select File > New > Project or press Ctrl+Shift+N. The Create a new project screen appears, where you can search and browse templates across different languages.
add python to path

To verify whether the Python is successfully installed or not type the following command on the command prompt.

python --version

The command will show the installed Python version.

python version check

Finally, open the Visual Studio Code and create a new file “app.py” or in any other name but the extension must be “py”.

To run Python code in VS Code, navigate to the project directory and type the following command.

python app.py
run python file in terminal

Output

run python code in vs code

Read Also: Merge Sort in PHP

Read Also: How to Run JavaScript Code in Visual Studio Code

Conclusion

I hope this article helps you to understand How to Run Python Code in Visual Studio Code(VS Code). If you encounter any issues let me know via the comment section.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment