Coding in Python with VS Code

Coding in Python with VS Code

After the installation of python as given inprevious blog, now it’s time to install VS Code and start coding with Python in VS Code.

So to install VS code we can follow these steps.

Step 1.

Go to URL https://code.visualstudio.com/download to download visual studio as per the machine requirements.

Download VS Code

Click on the window if you have a windows machine or follow the same for Linux and Mac.

Step 2.

After the installer is downloaded run the installer and let the installer file do the rest.

Running the installer file

Click on the “Run” button to start installing VS Code.

Step 3.

Once the installer starts to run, the following dialog box is seen

Licencing

Click on “I accept the agreement” to accept the license and the “Next” button will be enabled and click on that “Next” button to move forward.

Step 4.

Select a destination to install the file

Select Destination
Start Menu
Step 5.

Create a desktop launcher and add a path.

Path and desktop launcher
Step 6 :

Check if everything is right and click on install.

Installation
Installation process
Step 7:

After the setup is successful. Click on the “Launch ” checkbox to launch the VS Code.

Installation of VS Code
Step 8 :

Once VS Code is installed then it will be opened where we can code for multiple programming language.

VS Code
Step 9:

Now it is ready to code for the required language and since we are working for python so click on the “extension” given at the right side of the screen and write “python” in the search bar. Once python is written it will show all the available extensions of “python”

Python Extension
Step 10 :

Now when all the available option are shown click on the 1st available option and click “install”

Step 11:

After the python extension is installed then we can code for python. For that click on File and click on New File. And when a new window appears write the following code. Save the file with .py extension.

print "Hello World "

Hello_word.py file
Step 12:

Once the file is saved with python file extension then it is now ready to run the file. To run the file click in Run menu and click on “Run without debugging”

Running python file
Step 13:

Now it is necessary to locate the python interpreter in the VS Code. To do this click on the warning that is being shown at the bottom right corner in yellow color ” Select Python Interpreter” and a dialog box will appear to select the file. Now select the location of the python file installed.

Python interpreter
Step 14:

After setting up the python interpreter now the file is able to run. For that click on the run button provided by green color triangle at the top, and the output can be seen at the terminal.

Running python code

This way ” Hello World ” program can be done in python.

Share this on facebook

Subscribe to our Youtube Channel

Leave a comment

Your email address will not be published. Required fields are marked *