Home › Python › Running Python and Visual Studio Code in Windows
Python · Sep 9, 2019

Running Python and Visual Studio Code in Windows

In this post, we will look at how to run Python with Visual Studio Code in Windows.

To install Python, go to the Python download page at https://www.python.org/ and click on Downloads:

Click Download Python:

This will download the file:

Check Add Python to PATH and click to Install. Note this also installs IDLE (the IDE), pip (the package installer) and documentation:

Note customizing gives us:

Click Close once complete:

Note the links above are:

Now, IDLE is installed, and we can access it through the Windows Start menu:

Opening it, we can start typing commands:

Let’s see which modules are installed, by typing:

help("modules")

We see the modules installed:

We will use Visual Studio Code as our IDE to write Python scripts. Open VS Code and go to Extensions, and find the Python extension:

Click Install:

Now let’s install a module. From the Visual Studio terminal, let’s install Requests:

pip install requests

This installs the module:

To run a simple “Hello World”, enter the following text and save the file as HelloWorld.py. Right-click and run the code by selecting Run Python File in Terminal:

 

One Response to Running Python and Visual Studio Code in Windows

Leave a Reply

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

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.