Coding in Python with VS Code
After the installation of python as given in
, 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.
Go to URL
https://code.visualstudio.com/download to download visual studio as per the machine requirements.
Click on the window if you have a windows machine or follow the same for Linux and Mac.
After the installer is downloaded run the installer and let the installer file do the rest.
Click on the “Run” button to start installing VS Code.
Once the installer starts to run, the following dialog box is seen
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.
Select a destination to install the file
Create a desktop launcher and add a path.
Step 6 :
Check if everything is right and click on install.
After the setup is successful. Click on the “Launch ” checkbox to launch the VS Code.
Step 8 :
Once VS Code is installed then it will be opened where we can code for multiple programming language.
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”
Step 10 :
Now when all the available option are shown click on the 1st available option and click “install”
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
print "Hello World "
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”
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.
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.
This way ” Hello World ” program can be done in python.
Subscribe to our Youtube ChannelSubscribe