Running Python code in Visual Studio Code
1. Download and
install python latest version from https://www.python.org/downloads/.
2.
Download VS
code a software from Microsoft from the site https://code.visualstudio.com/.
3.
Make sure you download
the right software depending on the operating system(Windows, MAC, Linux) you
have in your system.
4.
Install it by double
clicking on the downloaded VSCodeUserSetup-x64-1.34.0.exe file.
5.
Double click to
open VS code, Welcome screen should look like below.
Welcome Screen
|
6. Click on the Extensions icon on the left hand
side marked red in image below.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfeAdTSx7E-AzCblqaii_HJepOB5O0ayb_MWBcfF0U6lDsqglTJ-a6VK6B2jJc1ocaB-rEhSbpmRP15e6W3GnPBlVpeTeNX8Xwgzx6e7BS-OD_DENvUKj4pNG07JvRHX_qU7pLggt92fF/s320/Untitled.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfeAdTSx7E-AzCblqaii_HJepOB5O0ayb_MWBcfF0U6lDsqglTJ-a6VK6B2jJc1ocaB-rEhSbpmRP15e6W3GnPBlVpeTeNX8Xwgzx6e7BS-OD_DENvUKj4pNG07JvRHX_qU7pLggt92fF/s320/Untitled.png)
7.
Click on the option or search for "Python Extension Pack" in
the search field marked red and click on install button marked red to install it on your system.
8.Next goto File menu and select "Open
Folder" Option to select the folder where you want to save
all your python scripts.
9.Now create a new python script inside the folder you just selected in
the previous step by going to the File menu and click "New File" option.
10. Once a new file has been created write any python script as shown below and Save the file by giving a name with an extension .py say "first.py".
10. Once a new file has been created write any python script as shown below and Save the file by giving a name with an extension .py say "first.py".
11.
Once you save the file with the .py extension the VS code will pick the python
installation in your
system automatically
and name with version will be visible in status bar as shown below.
12. To Run/Debug press
F5 , first time running a file will ask for a select "Python
File:" select Debug the currently active python File" and the output
will appear in the Terminal window.
Comments
Post a Comment