O'Reilly logo

Raspberry Pi: Amazing Projects from Scratch by Richard Grimmett, Matthew Poole, Arush Kakkar, Ashwin Pajankar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing PyGame

PyGame usually comes installed with the latest Raspbian distribution, but if it isn't you can use the following command to install it:

sudo apt-get install python-pygame

Test your installation by opening a Python terminal by entering python in a regular terminal and pressing Enter. Now, execute the following command:

import pygame

Now that you have your system set up and you have hopefully checked out the PyGame website to explore its complete functionalities, we will move on to build the binary fractal tree to introduce you to the workings of PyGame. Let's begin!

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required