Tooling reference

Running Python

Open a terminal, move to your folder, and run a Python script.

Last reviewed: 2026. The commands here are examples; the exact command and output depend on your operating system and setup. When something differs, prefer the official source for your tool.

What a terminal is

A terminal is a text window where you type commands to your computer instead of clicking. Every operating system ships one. You run the builds from here.

Folders and the current directory

The terminal is always sitting inside one folder, called the current working directory. Commands act relative to it, so where you are matters.

Change directory

cd path/to/your/folder

Use this to move into the folder that holds your script before you run it.

Run a script

Save your code as a file, for example q_learning.py, then run:

python3 q_learning.py

REPL versus script

Typing python3 on its own opens an interactive prompt, the REPL, where you run one line at a time. Running python3 file.py runs a whole file start to finish. The builds are files, so use the file form.

Stop a stuck script

Press Ctrl-C in the terminal to interrupt a running script.

Common traps