INTRODUCTION - Programming the Raspberry Pi: Getting Started with Python (2013)

Programming the Raspberry Pi: Getting Started with Python (2013)

INTRODUCTION

The Raspberry Pi is rapidly becoming a worldwide phenomena. People are waking up to the possibility of a $35 (U.S.) computer that can be put to use in all sorts of settings—from a desktop workstation to a media center to a controller for a home automation system.

This book explains in simple terms, to both nonprogrammers and programmers new to the Raspberry Pi, how to start writing programs for the Pi in the popular Python programming language. It then goes on to give you the basics of creating graphical user interfaces and simple games using the pygame module.

The software in the book mostly uses Python 3, with the occasional use of Python 2 where necessary for module availability. The Raspbian Wheezy distribution recommended by the Raspberry Pi Foundation is used throughout the book.

The book starts with an introduction to the Raspberry Pi and covers the topics of buying the necessary accessories and setting everything up. You then get an introduction to programming while you gradually work your way through the next few chapters. Concepts are illustrated with sample applications that will get you started programming your Raspberry Pi.

Three chapters are devoted to programming and using the Raspberry Pi’s GPIO connector, which allows the device to be attached to external electronics. These chapters include two sample projects—one for making an LED clock and the other a Raspberry Pi controller robot, complete with ultrasonic rangefinder.

Here are the key topics covered in the book:

• Python numbers, variables, and other basic concepts

• Strings, lists, dictionaries, and other Python data structures

• Modules and object orientation

• Files and the Internet

• Graphical user interfaces using Tkinter

• Game programming using Pygame

• Interfacing with hardware via the GPIO connector

• Sample hardware projects

All the code listings in the book are available for download from the book’s website at http://www.raspberrypibook.com, where you can also find other useful material relating to the book, including errata.





All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)

If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.

© 2016-2026 All site design rights belong to S.Y.A.