The WiringPi project is a library written in C that makes it easy to work with the GPIO. It has been actively updated with each board revision, includes command-line utilities, and has several wrappers available in higher-level languages such as Ruby and Python.
For this recipe, you will want to install the GPIO libraries for the Raspberry Pi. You might already have them installed, but it is easy enough to make sure it is installed and upgraded, with the following commands:
sudo apt-get install wiringpi sudo apt-get upgrade wiringpi
You'll also want to get the Python wrapper installed, which you can do with this command:
sudo pip install wiringpi2