Pygame

Make games and multimedia apps in Python

4.7
Version
2.6.1
Released
2024-09-29
Size
10.6 MB
License
LGPL · Open source
GamesWindowsLinuxmacOSOpen source

About Pygame

Pygame is the library that taught a generation of programmers how games work. It's a free, open-source set of Python modules built on top of SDL, the same battle-tested C layer used by commercial games, and it handles the unglamorous parts of game development - windows, graphics, input, sound - so you can focus on your idea. Released under the LGPL, it's free for any use, including commercial games, and it has been maintained continuously since 2000.

The model is refreshingly direct. You get a window, you draw Surfaces onto it every frame, you read keyboard, mouse and gamepad events, and you play sounds through the mixer. Sprites, image transforms, primitive drawing, fonts, music streaming and collision helpers are all in the box, and optional modules cover MIDI output, clipboard access and camera input. There's no editor, no scene tree and no engine telling you how to structure your game: you write a Python loop, and everything that happens on screen is code you wrote. That's exactly what makes it such a good teaching tool - and such a satisfying way to prototype.

Because it's Python, the ecosystem does half the teaching for you. Thousands of tutorials, several books, and two decades of forum answers cover every beginner question imaginable, and the PyWeek game jam has produced hundreds of complete, open-source pygame games you can learn from. The best-known release built on it is probably Frets on Fire, the open-source guitar rhythm game that won its category at the Assembly demo party, and the library remains a staple of university courses and coding clubs. Version 2.6.1 (September 29, 2024) runs on Python 3.6 and newer, with ready-made wheels for Windows, macOS and Linux, so installing it is one pip command. The project is deliberately conservative: releases are rare, stable and backwards compatible, which is exactly what you want when you're teaching with it. It also runs happily on a Raspberry Pi, a favorite for school projects and handheld builds.

Our verdict: if you know a little Python and want to make a game tonight, pygame is still the shortest path from idea to playable. Reach for it for 2D games, prototypes, teaching and jams. If your project needs 3D, a level editor or console exports, you're looking for a full engine like Godot instead.

Image credits: screenshots via Wikimedia Commons (CC0). Logo: pygame project.

Key Features

Python Integration

Seamlessly integrates with Python's clear syntax, making game development accessible. Perfect for beginners learning programming while creating games, and powerful enough for experienced developers prototyping ideas or creating full commercial projects.

2D Graphics and Sprites

Hardware-friendly Surface drawing with blitting, image loading and saving, scaling, rotation, per-pixel access and primitive shapes, plus a sprite system with collision helpers.

Input, Sound and Music

Keyboard, mouse and joystick events, plus a multi-channel mixer for sound effects and streaming music playback in common formats.

Cross-Platform via SDL2

The same code runs on Windows, macOS and Linux, and even on Raspberry Pi, thanks to the SDL2 layer underneath. One pip install gets you started.

Pros & Cons

Pros

  • The shortest path from Python basics to a playable 2D game
  • Mature and stable: maintained since 2000, backwards compatible, rare breaking changes
  • LGPL license: free for any use, including commercial and closed-source games
  • One-command install with prebuilt wheels for all major platforms

Cons

  • Strictly 2D: no real 3D support
  • No editor or engine features: you build structure, tools and UI yourself
  • Performance ceiling well below native frameworks for demanding games

Frequently Asked Questions

Is Pygame suitable for beginners?

Yes. pygame is one of the friendliest ways to start game programming: a plain Python loop, immediate visual results, and thousands of tutorials, books and course materials to lean on.

Can I sell a game made with pygame?

Yes. The LGPL license lets you ship commercial, closed-source games with pygame. You just can't modify pygame itself without publishing those changes.

Pygame or Godot?

pygame is a programming library: total control, no editor, ideal for learning and 2D projects. Godot is a full engine with a visual editor, better for larger games and 3D.

Quick Info

DeveloperPygame Community
LicenseLGPL · Open source
Version2.6.1
Size10.6 MB
Sourcepygame.org
Listing updated1 Nov 2026