Table of Contents
1 Getting started 7
Introducing Raspberry Pi 8
Gathering the components 10
Setting up the SD card 12
Configuring the system 14
Logging into the console 16
Starting the desktop 18
Automating the login 20
Summary 22
2 Exploring the desktop 23
Understanding the taskbar 24
Choosing your preferences 26
Examining the filesystem 28
Launching a terminal 30
Creating a text file 32
Browsing the internet 34
Extending the system 36
Summary 38
3 Commanding the system 39
Listing contents 40
Getting applications 42
Saving web pages 44
Reading & writing text 46
Finding files 48
Adding users 50
Changing permissions 52
Employing the shell 54
Creating shell scripts 56
Summary 58
4 Animating with Scratch 59
Walking a sprite 60
Changing directions 62
Adding another sprite 64
Editing costumes 66
Turning around 68
Reacting to touch 70
Playing sounds 72
Summary 74
5 Programming with Python 75
Introducing the interpreter 76
Writing your first program 78
Writing lists 80
Manipulating lists 82
Fixing in tuples 84
Collecting in sets 86
Associating in dictionaries 88
Testing expressions 90
Looping while true 92
Looping over items 94
Looping for a number 96
Breaking out of loops 98
Defining functions 100
Supplying arguments 102
Summary 104
6 Importing modules 105
Storing functions 106
Owning function names 108
Formatting strings 110
Reading & writing files 112
Pickling objects 114
Handling exceptions 116
Defining classes 118
Inheriting features 120
Interrogating the system 122
Performing mathematics 124
Calculating decimals 126
Telling the time 128
Summary 130
7 Producing games 131
Creating a game window 132
Painting shapes 134
Blitting objects 136
Playing sounds 138
Moving images 140
Animating sprites 142
Detecting collisions 144
Summary 146
8 Developing windowed apps 147
Introducing Tkinter 148
Adding widgets 150
Responding to buttons 152
Producing messages 154
Gathering entries 156
Listing options 158
Polling radio buttons 160
Checking boxes 162
Displaying images 164
Adjusting attributes 166
Managing layouts 168
Summary 170
9 Driving header pins 171
Understanding pin numbering 172
Lighting a lamp 174
Directing output 176
Adding more lamps 178
Recognizing input 180
Adding more buttons 182
Controlling projects 184
Summary 186
Index 187