HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
In just 24 sessions of one hour or less, Sams Teach Yourself Python Programming for Raspberry Pi in 24 Hours teaches you Python programmingon Raspberry Pi, so you can start creating awesome projects for homeautomation, home theater, gaming, and more. Using this book’s straightforward,step-by-step approach, you’ll move from the absolute basics all theway through network and web connections, multimedia, and even connectingwith electronic circuits for sensing and robotics. Every lesson and casestudy application builds on what you’ve already learned, giving you arock-solid foundation for real-world success!
Step-by-step instructions carefully walk you through the most common Raspberry Pi Python programming tasks.
Quizzes at the end of each chapter help you test your knowledge.
By the Way notes present interesting information related to the discussion.
Did You Know? tips offer advice or show you easier ways to perform tasks.
Watch Out! cautions alert you to possible problems and give you advice on how to avoid them.
Understanding Python Basics for Raspberry Pi
Download the sample pages (includes Chapter 4 and Index)
Introduction 1
Programming with Python 1
Who Should Read This Book? 2
Conventions Used in This Book 3
Part I: The Raspberry Pi Programming Environment
HOUR 1: Setting Up the Raspberry Pi 7
What Is a Raspberry Pi? 7
Acquiring a Raspberry Pi 9
What Raspberry Pi Peripherals Are Necessary? 11
Nice Additional Peripherals 17
Deciding How to Purchase Peripherals 19
Getting Your Raspberry Pi Working 19
Troubleshooting Your Raspberry Pi 24
Summary 25
Q&A 25
Workshop 26
HOUR 2: Understanding the Raspbian Linux Distribution 27
Learning About Linux 27
Interacting with the Raspbian Command Line 28
Interacting with the Raspbian GUI 33
Summary 43
Q&A 43
Workshop 44
HOUR 3: Setting Up a Programming Environment 45
Exploring Python 45
Checking Your Python Environment 46
Installing Python and Tools 48
Learning About the Python Interpreter 50
Learning About the Python Interactive Shell 51
Learning About the Python Development Environment Shell 54
Creating Python Scripts 59
Knowing Which Tool to Use and When 65
Summary 66
Q&A 66
Workshop 67
Part II: Python Fundamentals
HOUR 4: Understanding Python Basics 71
Producing Python Script Output 71
Formatting Scripts for Readability 78
Understanding Python Variables 81
Assigning Value to Python Variables 82
Learning About Python Data Types 86
Allowing Python Script Input 88
Summary 94
Q&A 95
Workshop 95
HOUR 5: Using Arithmetic in Your Programs 97
Working with Math Operators 97
Calculating with Fractions 103
Using Complex Number Math 105
Getting Fancy with the math Module 106
Using the