Python Programming Tutorial: Getting Started with the Raspberry Pi

Pages
Contributors: ShawnHymel
Favorited Favorite 7

Introduction

The Raspberry Pi is an amazing single board computer (SBC) capable of running Linux and a whole host of applications. Python is a beginner-friendly programming language that is used in schools, web development, scientific research, and in many other industries. This guide will walk you through writing your own programs with Python to blink lights, respond to button pushes, read sensors, and log data on the Raspberry Pi.

Speaker, button, and LED connected to a Raspberry Pi

Notice: This tutorial was written with Raspbian version "April 2018" and Python version 3.5.3. Other versions may affect how some of the steps in this guide are performed.

Required Materials

To work through the activities in this tutorial, you will need a few pieces of hardware:

Optional Materials

You have several options when it comes to working with the Raspberry Pi. Most commonly, the Pi is used as a standalone computer, which requires a monitor, keyboard, and mouse (listed below). To save on costs, the Pi can also be used as a headless computer (without a monitor, keyboard, and mouse). This setup has a slightly more difficult learning curve, as you will need to use the command-line interface (CLI) from another computer.

Raspberry Pi LCD - 7" Touchscreen

Raspberry Pi LCD - 7" Touchscreen

LCD-13733
$64.95
36
SmartiPi Touch

SmartiPi Touch

PRT-14059
$24.95
8
Multimedia Wireless Keyboard

Multimedia Wireless Keyboard

WIG-14271
$29.95
2
Please note: If you have trouble seeing any of the images throughout this tutorial, feel free to click on it to get a better look!

Open Source!

This guide is licensed under the Creative Commons Attribution Share-Alike 4.0 International License.

Python Logo