Python Programming for Raspberry Pi: A Beginner's Guide and Practical Course (2nd Edition)

Richard Blum / Christine BresnahanPosts & Telecom Press2016

No rating yet
Word count
741K words
Chapters
33
ISBN
9787115426703

Tags

Computing Programming Block ProgrammingOpen Source HardwareException HandlingRaspberry PiHardware ProgrammingProgramming DesignObject-Oriented ProgrammingProgramming Primer

Summary

Python Programming for Raspberry Pi: A Beginner's Guide and Practical Course (2nd Edition) is the Chinese translation of the second edition of Sams Teach Yourself Python Programming for Raspberry Pi in 24 Hours. Organized in a "24-hour" lesson structure, the book places the use of the Raspberry Pi and the learning of Python on the same main line: solve hardware and system issues first, build language knowledge layer by layer next, and finally return to real projects. The text is divided into seven parts. Part 1 covers the Raspberry Pi programming environment, including hardware configuration and peripheral selection, basic operation of the Raspbian Linux distribution, the command line and graphical interface, setting up the programming environment and the Python interpreter, and use of the interactive shell. Part 2 covers Python fundamentals, from variables, data types and input/output to arithmetic operations, conditionals and loops. Part 3 moves into advanced topics: lists and tuples, dictionaries and sets, string processing, file reading and writing, functions, modules, object-oriented programming and inheritance, regular expressions and exception handling. Part 4 covers graphical programming, including GUI development and an introduction to game programming. Part 5 addresses applied programming, involving networking, databases and web programming. Part 6 presents two complete Raspberry Pi Python projects, moving from basic exercises to more comprehensive practice. Part 7 consists of appendices explaining how to write the Raspbian system image to an SD card and introducing the various Raspberry Pi versions and models. Using the low-cost Linux single-board computer as its vehicle, the book emphasizes learning by doing on real hardware and suits self-study or training courses for complete beginners. Terminology follows the second edition; some tools and system versions are no longer current, so readers should consult up-to-date Raspberry Pi documentation alongside the book.

Editor's review

很多树莓派书只讲「怎么点亮一个LED」,很多Python书只讲语法、不接硬件;这本书的价值在于把两条线缝在一起:你买的不是一块吃灰的板子,而是一台可以边学边调的Linux小电脑。 结构上它采用「24小时」课程式编排,每一章都配有小节总结、Q&A 和练习题,学完能立刻自查哪里没懂,这对零基础读者比一口气读完几十页代码友好得多。前三章先把系统烧录、命令行、外设和编程环境讲清楚,避开了新手最常见的「卡在开机那一步」。中间部分从变量、循环一路讲到文件、函数、类与继承、正则和异常,覆盖面接近一门 Python 入门课,而且示例都运行在树莓派上,不是抽象的伪代码。后半程的 GUI、游戏、网络、数据库、Web 和两个完整项目,则给出「从学到做」的落点。 需要注意的是,本书是第2版译文,内容对应较早版本的 Raspbian 与树莓派型号;系统界面、部分库的安装方式已有变化。建议把它当作主干教材,遇到具体操作时以当前官方文档为准。若你手里正好有一块树莓派,并且想一次把 Linux 基础、Python 语法和硬件实践打通,这本书仍是扎实的选择。

Who it's for

A good fit for

Not a good fit for

Reading tips

  1. 先按第一部分把系统烧录、联网和编程环境跑通,不要跳过动手环节。
  2. 每章末尾的 Q&A 和练习至少做一遍,卡住的地方再回看对应小节。
  3. 案例代码建议亲手敲一遍而不是复制,改几个参数观察结果变化,理解会更牢。
  4. 书中系统与工具版本较旧,遇到界面或安装命令不一致时,以官方文档为准。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Part 1: The Raspberry Pi Programming Environment
  2. Chapter 1: Configuring the Raspberry Pi
  3. Chapter 2: Getting to Know the Raspbian Linux Distribution
  4. Chapter 3: Setting Up the Programming Environment
  5. Part 2: Python Fundamentals
  6. Chapter 4: Python Basics
  7. Chapter 5: Using Arithmetic in Programs
  8. Chapter 6: Controlling Your Program
  9. Chapter 7: Loops
  10. Part 3: Advanced Python Knowledge
  11. Chapter 8: Using Lists and Tuples
  12. Chapter 9: Dictionaries and Sets
  13. Chapter 10: Working with Strings
  14. Chapter 11: Working with Files
  15. Chapter 12: Creating Functions
  16. Chapter 13: Using Modules
  17. Chapter 14: Exploring the World of Object-Oriented Programming
  18. Chapter 15: Using Inheritance
  19. Chapter 16: Regular Expressions
  20. Chapter 17: Exception Handling
  21. Part 4: Graphical Programming
  22. Chapter 18: GUI Programming
  23. Chapter 19: Game Programming
  24. Part 5: Applied Programming
  25. Chapter 20: Using Networks
  26. Chapter 21: Using Databases in Programs
  27. Chapter 22: Web Programming
  28. Part 6: Raspberry Pi Python Projects
  29. Chapter 23: Creating a Basic Raspberry Pi Python Project
  30. Chapter 24: Advanced Raspberry Pi/Python Project
  31. Part 7: Appendices
  32. Appendix A: Loading the Raspbian Operating System onto an SD Card
  33. Appendix B: Overview of Raspberry Pi Models

FAQ

这本书和科学出版社的《Raspberry Pi Python编程入门》是同一本吗? 不是。科学出版社2014年版由 Simon Monk 著、姜斐祚翻译,原书为《Programming the Raspberry Pi》。本书由 Richard Blum 与 Christine Bresnahan 合著,译自《Sams Teach Yourself Python Programming for Raspberry Pi in 24 Hours》第2版,人民邮电出版社出版。
没有树莓派硬件,只读书能学吗? 书中的 Python 语法章节基本可以在普通电脑上练习,但硬件配置、GPIO、项目实践等内容需要树莓派配合。若没有硬件,建议先读语言部分,再考虑入手一块板子动手完成项目。
这本书有第1版吗?两版差别大吗? 有。第1版的 ISBN 是 9787115391186,2015年出版;第2版 2016年出版,ISBN 为 9787115426703,页数和篇幅有所增加,章节结构也做了调整。
书中内容现在还算过时吗? Python 语法与编程思想部分基本不过时;但 Raspbian 系统界面、SD 卡烧录方式和个别库的安装方法已有变化。学语言和思路仍可用,具体操作建议对照当前官方资料。
适合完全没有编程基础的人直接读吗? 适合。全书从配置硬件与认识 Linux 讲起,Python 部分从变量和输出讲起,并配有总结与练习。但需要读者愿意动手操作命令行,不能只做纸面阅读。

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.

About the author

Richard Blum Author

Richard Blum is an author of computer technology books, with three of his works held in this collection. Public information about him is limited, and his nationality, dates of birth and death, and detailed personal background cannot be confirmed, so this introduction relies only on his works. The available titles show that Blum's writing focuses on Linux system operation and shell scripting, as well as introductory Python practice on the Raspberry Pi platform; his books commonly fall under computer science, software learning, and programming design. His representative work, Linux Command Line and Shell Scripting Bible (4th Edition), is aimed at readers who want to systematically master command-line operations and shell scripting, with an emphasis on practical skills, while Raspberry Pi Python Programming for Beginners (2nd Edition) combines a small hardware platform with an introduction to Python programming. Overall, his books are mainly reference works and beginner-friendly tutorials that stress hands-on practice and step-by-step learning, making them suitable for self-study and classroom use.

Christine Bresnahan Author

Christine Bresnahan is a computer book author about whom limited public information is available, and her biography can currently be introduced only on the basis of the work included in the library. Her book Raspberry Pi Python Programming: A Beginner's Guide and Practical Course (2nd Edition) is a computing and programming design title aimed at readers who wish to learn Python programming with the Raspberry Pi. The subject matter combines introductory instruction with hands-on practice, explaining programming fundamentals while guiding readers to work on the Raspberry Pi hardware platform, which makes it suitable for beginners to follow and operate step by step. Because public information is limited, her nationality, education, professional experience and awards cannot be confirmed, and no excessive inferences should be made about her writing style. Overall, her work addresses beginning programming readers and emphasizes practical operation, offering a representative example in popular computing literature for interested learners.