Getting Started


How to check Python is installed on a Windows machine ?
open command prompt
type "py"

link - code.visualstudio.com/docs/python/python-tutorial#_prerequisites 
link - learn.microsoft.com/en-us/training/browse/?terms=python
link - github.com/microsoft/c9-python-getting-started

Download Python

To install Python on Windows, go to the python.org download page and download Python 3.X.X.
Run the Python installer and accept all the defaults.
This will install Python in the following default folder:

folder - C:\Users\ "username" \AppData\Local\Programs\Python 

Make sure you add Python to PATH. This allows you to use the python command in a terminal to run Python programs
This will also allow you easily install packages using the pip command from inside VS Code
If you only have one version of Python installed then adding Python to PATH makes sense.


VS Code Python Extension

Install the extension called "Python"
Select (File > New File > Python File)
type the following

print("hello world!") 

select (File > Save As)

folder - C:\temp\python\Untitled-1.py 

Select the triangle in the top right corner (Run Python File)
You see the following message appear in the Terminal window at the bottom


Virtual Environment

A python environment is a self contained folder that defines the corresponding python interpreter and any additional libraries/packages.
It is an isolated workspace for a specific project.
To see your current environment, look in the bottom right corner of VS Code for (.venv (3.12.7) )



Type the following code 
print(f"Addition: 10 + 5 = {10 = 5}")
print(f"Division: 10/4 = {10/4:.2f}")
print(f"Integer Division : 10//4 = {10//4}")


The Debug.Console is the same as the Immediate Window in VBA




Start Debugging

Enter some code
Set a breakpoint
Press F5
Select "Python Debugger"
Select "Python File"
Wait for a few seconds
Press F10 to move to the next line
Press F5 to run until the end
You will see the Run and Debug pane on the left
This pane has four panels: Variables, Watch, Call Stack and Breakpoints.




To switch to your local environment
Run the following in the Terminal window

.venv\scripts\activate 

To install the numpy package

pip install numpy 

If you lose your environment
(Ctrl + Shift + P), select/type "Python Select Interpreter"


Type "cls" in the terminal window to clear window and move the cursor to the top



Add some comments, prefixing with #

# this is a comment 

Ctrl + K + C - comment a line
Ctrl + K + U - uncomment a line



© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext