How to Run Python Games on Your Computer

The console games on this site run in your browser, but running Python on your own computer lets you play the keyboard-controlled turtle games, save your work and build bigger projects. It takes about five minutes.

1. Install Python

2. Save the game

Open IDLE (it comes with Python), choose File → New File, paste the game code and save it as something like snake.py. Any editor works: VS Code, Thonny, PyCharm, even Notepad.

3. Run it

Fixing common problems

MessageWhat it means
'python' is not recognizedPython isn't on your PATH. Reinstall and tick Add to PATH, or try py snake.py on Windows.
IndentationErrorThe paste lost or mixed spaces. Re-indent with 4 spaces per level.
ModuleNotFoundError: No module named 'tkinter'Turtle needs Tk. On Linux install python3-tk.
The turtle window closes at onceAdd turtle.done() at the end of the program.
ModuleNotFoundError: No module named 'pygame'Run pip install pygame (only needed for pygame games).

Check your setup

Save this as check.py and run it. If you see the version and a window with a turtle, you're ready for every game here.

import sys
import turtle

print("Python", sys.version.split()[0], "is working!")
t = turtle.Turtle()
t.shape("turtle")
t.forward(100)
turtle.done()

Frequently asked questions

Do I need pygame to run these games?

No. All 20 games use only modules that come with Python, including turtle for the graphical ones.

Can I run Python games on a phone?

The console games run in your phone's browser on this site. Turtle games with keyboard control need a computer or a Python app that supports Tk.