[Easy Tutorial] How to install Visual Studio Code(VSC) in Windows 10/11, Run Python file in Visual Studio

An integrated development environment (IDE) made by Microsoft is known as Visual Studio. It is used to create software for Microsoft Windows. For all applications created on the.Net platform, Visual Studio serves as a one-stop-shop. Applications can be created, tested, and run using Visual Studio.

This IDE can be used to design and develop web-based and forms-based applications. A step-by-step tutorial for installing Visual Studio is provided here.

Guide to Download and Install Visual Studio in Windows 

Have a look at the Visual Studio installation procedures and download the Visual Studio IDE. We will learn how to download Visual Studio for Windows in this article.

  1. Go to official website of Visual Studio Code
  2. Click on Download for Windows as shown in image:
  3. Once the installer is downloaded, click to open.
  4. Now Check the agreement to start the installation and click on the next button.

  5. Click on next button again.

  6. Make sure, it is checked on Add to Path(else you have to add manually later) and click on next.

  7. Once the installation is completed, you can launch it by click on finish button.

How to run Python file in Visual Studio

In this article, you will use Visual Studio Code to develop the most basic Python "Hello World" application using Python 3. You can transform VS Code into a fantastic, lightweight Python IDE by using the Python plugin (which you may find a productive alternative to PyCharm).

Through the following exercises, this tutorial introduces you to VS Code as a Python environment and teaches you how to edit, run, and debug code:
Create a Python "Hello World" application, execute it, and fix any bugs.
By setting up Python virtual environments, you can learn how to install packages.
You won't learn Python itself in this session. Once you are familiar with VS Code's fundamentals
 

Prerequisites

You must first set up your Python development environment in order to finish this lesson. In particular, this tutorial needs:

  • Download and Install VS Code (Go through the above steps if you haven't installed yet)
  • Download and install the python extension for python 3.
  • Install python 3 manually on your system.
How to download and install Python Extension
  1. Go to Visual Studio MarketPlace by clicking on the icon as shown in image:

  2. Download Python 3 from Python.org. Install it on the system.

  3. Verify the python installation by running following command on cmd:
    py -3 --version
  4. Create a folder on desktop and create a python file with .py extension
  5. Now open Visual studio and add folder you have create earlier as shown in image:
  6. Open the python file in the folder.
  7. write the following python code to run:

    print("Hello World")
  8. Click on the icon as shown in image to execute the python code:
  9. Output can be seen in terminal:
Conclusion: Hope you enjoyed full tutorial of installing Visual Studio Code and running first python code on Visual Studio Code. Keep on visiting for such tutorials. You can watch the video tutorial below on my youtube channel:

Post a Comment

Previous Post Next Post

Ads

Ad