How to Install Python and VSCode on Windows
Want to get started with Python programming? Here’s a quick, step-by-step guide to installing Python and Visual Studio Code (VSCode) on Windows.
Step 1: Download and Install Python
1. Download Python
- Head to the official Python download page.
You should see a big yellow button labeled “Download Python 3.x.x” (the latest version number). Click it to start the download.
2. Install Python
- Open the downloaded installer file.
- Important: Check the box that says “Add Python to PATH”. This makes running Python from the command line easier.
- Choose Install Now and let the installer run.
Once the installation finishes, click Close.
3. Verify the Installation
To confirm Python is installed correctly:
1. Open Command Prompt (search “cmd” in the Start menu).
2. Type python --version
and hit Enter.
– If installed correctly, you should see the Python version number displayed.
Step 2: Download and Install Visual Studio Code (VSCode)
1. Download VSCode
- Go to the VSCode download page.
Choose the Windows option to start the download.
2. Install VSCode
- Open the downloaded installer file.
- Follow the on-screen instructions, and when you reach the setup screen, check the following boxes:
- Add “Open with Code” action to Windows Explorer (optional but useful).
- Add to PATH (recommended for terminal usage).
Continue with the installation, and when it’s complete, click Finish.
Step 3: Set Up Python in VSCode
1. Open VSCode and Install the Python Extension
- Launch VSCode.
- Go to the Extensions sidebar (click the four-square boxes icon or press
Ctrl+Shift+X
). - Search for Python and select the one by Microsoft.
Click Install to add the Python extension.
2. Verify Python Extension in a New File
- Create a new file by clicking File > New File.
- Save it as
test.py
. Type a simple line of code like
print("Hello, Python!")
and save the file.
3. Run Python Code in VSCode
Right-click on the code and choose Run Python File in Terminal. This will open a terminal at the bottom of VSCode and execute the code.
- You should see
Hello, Python!
printed in the terminal.
- You should see
That's It!
🎉 Congratulations! You now have Python and VSCode fully set up on your Windows computer!
Keep coding, and check back for more guides to improve your development experience.
Further Reading
Why Catching All Exceptions is a Bad Idea in Python
#blog #python #vscode #tutorial #programming #joeymanani
Sidenote
The application I used to simulate the screenshots was the Windows Sandbox
– similar to a VM – and can be installed on your host machine in the builtin program Turn Windows features on or off
inside of your start menu.
I realised that I can use FFmpeg to convert PNG screenshots to WebP to compress them and optimize webpage load times. Pretty cool!