Gaming the System with Python


Traditionally, scripting languages help administrators manage systems

with relatively small scripts. Python is used in this capacity as well

as for larger applications such as installation programs. The latest

effort, though, uses a library and tools from the PyGame effort to take

Python into the realm of interactive gaming.

PyGame ( offers a Python-based game development

library built on the Simple DirectMedia Layer (SDL). SDL

(, the premier Linux library for graphics-heavy

games, provides multimedia capabilities on a number of platforms,

including Linux. SDL is similar to DirectX, but it supports multiple

platforms. A number of commercial games, especially those ported by the

now-defunct Loki ( use SDL. Possible Worlds, a

game covered here previously, also uses SDL.

SDL is an impressive effort. By building on top of SDL, the PyGame

effort lets Python developers take advantage of the richness in

multimedia that game users take for granted to build quite a respectable

game entirely in Python. Python developers should check out the nice

tutorial at for an

explanation of PyGame's offering. PyGame also provides a code repository

at, which is full of small

routines to help speed game development.

SDL and Python, both already multi-platform tools, make supporting

multiple platforms a lot easier. One of the most advanced games written

with the PyGame tools, Civil, an American Civil War strategy game,

demonstrates SDL and Python's cross-platform prowess by supporting

Linux, MacOS X, Windows, and BSD UNIX versions of the game. Civil

( is a turn-based strategy game that

focuses on small battles from the Civil War. An extensive manual

explaining how to play the game can be found at

Civil's main drawback is that, so far, you need to download the code

from CVS in order to play (see for details). That should

change, however, as the game nears a 1.0 release from the current 0.7

version. More importantly, the PyGame tools are slowly tearing down the

barriers preventing Linux developers from making good games, and I

expect the future will see more quality Linux efforts like Civil.

Now Read This IT Resume Makeover: Our top 11 tips
You Might Like