Python Programming with Raspberry Pi cover

Python Programming with Raspberry Pi

No rating yet
Chapters
16
ISBN
9787111550303

Tags

Summary

Python Programming with Raspberry Pi is a hands-on introductory book that treats microcomputers, Python programming, and electronics together. It begins with the most basic hardware: the origins and board generations of the Raspberry Pi, SD cards and power supplies, HDMI and audio-video ports, Ethernet and USB, and, most importantly, the GPIO pins. In one chapter it explains what this credit-card-sized board can do, which peripherals it needs, and how to install the system with NOOBS and complete initial setup. With the hardware and operating system prepared, the book introduces the command-line operations, file system, root and sudo, package manager, and text editors such as vim, emacs, and nano needed in the Raspberry Pi Linux environment, then systematically covers Python's syntax basics in a chapter, including data types, lists and dictionaries, conditionals, loops, functions, and object-oriented programming. The most valuable part is the projects section: the author presents a series of hands-on projects—a web bot, a weather station, a media server, a home security system, a cat toy, a radio-controlled airplane, a weather balloon, an underwater probe, and more—explaining for each the parts list, wiring, modules used (such as mechanize, Beautiful Soup, urllib, and I2C sensors), and the complete code approach. Finally, it introduces how to combine the Raspberry Pi with an Arduino using the Gertboard expansion board. Readers can follow these projects to run Python code on real-world sensors and actuators.

Editor's review

市面上的树莓派书大致分两类:一类是讲系统与运维的“上手指南”,一类是堆代码的“项目合集”。这本书难得地把两件事接上了:你买树莓派不是为了多一台电脑,而是为了让程序能吹到风、测到温度、动起来。 作者的路线安排很务实。前三章几乎全在打地基:硬件认知、Linux 命令行、Python 语法,一步不跳,明确照顾“没有编程基础、也没碰过 Linux”的读者。第四章讲电学常识、万用表、面包板、电烙铁与安全规范,这恰恰是很多软件背景的创客最缺的一环,安排在这里显出了作者的诚意。后面的项目从纯软件的网络机器人逐步过渡到需要接线的气象站、安防系统和遥控飞机,难度是爬坡式的,而不是断崖式的。 需要提醒的是,本书英文原版出版于 2014 年,中文版译自初版。书中涉及的 Raspbian 界面、NOOBS 安装方式、Python 2 时代的部分写法以及树莓派型号,与今天的环境已有差距。因此建议把它当作“项目思路与硬件原理书”来读:接线逻辑、传感器选型、I2C 通信、用 Python 处理网络数据这些内容不会过时,具体命令和软件版本则需配合官方最新文档替换。对于想从写脚本转向做实体装置的人,这仍是一本路径清晰、带着你从零把东西做出来的书。

Who it's for

A good fit for

  • 刚买树莓派、想把板子真正用起来而不是吃灰的初学者
  • 会一点 Python 但完全没接触过电子元件与接线的开发者
  • 想带孩子或学生做软硬件结合项目的老师与家长
  • 需要一本从环境配置到项目落地的入门书做参考的创客

Not a good fit for

  • 想系统学习 Linux 系统管理与运维的读者,书中仅覆盖最基本的命令
  • 希望使用 Python 3 与当前 Raspberry Pi OS 直接照抄命令的读者
  • 寻找深入讲解某一硬件协议或高级 Python 工程实践的资深开发者

Reading tips

  1. 先用手里或官方镜像提供的当前版 Raspberry Pi OS 完成系统安装,不要完全照着书中的 NOOBS 流程操作
  2. 前三章可以快速通读,遇到具体操作时再回查;从第5章开始建议边读边动手做
  3. 每个项目先按书列出零件清单,从网络机器人这类不需要额外硬件的项目起步
  4. 把书中的 Python 代码在 Python 3 环境下跑一遍,遇到语法差异时以官方文档为准

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Translator's Preface
  2. Foreword
  3. Chapter 1 Introduction to Raspberry Pi
  4. Chapter 2 Mastering Linux with Ease
  5. Chapter 3 Getting Started with Python
  6. Chapter 4 A Grand View of Electronics
  7. Chapter 5 A Networked Robot
  8. Chapter 6 Weather Station
  9. Chapter 7 Media Server
  10. Chapter 8 Home Security System
  11. Chapter 9 Cat Toy
  12. Chapter 10 Radio-Controlled Airplane
  13. Chapter 11 Weather Balloon
  14. Chapter 12 Underwater Explorer
  15. Chapter 13 The Gertboard Expansion Board
  16. Chapter 14 Raspberry Pi and Arduino

FAQ

这本书和《树莓派Python编程入门与实战》是同一本吗?
不是。本书是 Wolfram Donat 所著 Learn Raspberry Pi Programming with Python 的中译本,机械工业出版社 2016 年出版;《树莓派Python编程入门与实战》则是 Richard Blum 与 Christine Bresnahan 著、人民邮电出版社出版的另一本书。
书中的代码是 Python 2 还是 Python 3?
英文原版出版于 2014 年,当时树莓派系统仍以 Python 2 为主,中文版未做全面改写。书中的语法与思路大体通用,但个别写法在 Python 3 下需要调整,建议配合官方文档验证。
没有电子基础能看懂吗?
可以。第4章专门从电学基本概念、常用工具、面包板与焊接安全讲起,后续项目的接线说明也比较细。但仍建议备好万用表与面包板,实际操作时注意用电安全。
这本书有没有原书第2版的中译本?
有。机械工业出版社出版了《Python树莓派编程(原书第2版)》,ISBN 为 9787111695967。若你希望内容更贴近较新的树莓派板型,可以直接选择第2版。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category