Python Playground: Geeky Projects for the Curious Programmer cover

Python Playground: Geeky Projects for the Curious Programmer

Rating 4.2
Chapters
22
ISBN
9787115449764

Tags

Summary

Python Playground: Geeky Projects for the Curious Programmer is a project-driven, hands-on Python book by Indian-born software engineer Mahesh Venkitachalam; the Chinese edition was translated by Wang Haipeng and published by Posts & Telecom Press in 2017. Rather than teaching Python syntax systematically, the book assumes readers already grasp basic syntax and programming concepts, and takes them straight into building projects, letting them experience the language's expressive power and the use of common libraries while solving concrete problems. The projects span mathematical graphics, artificial life, 2D image processing, 3D rendering, and hardware interaction: drawing spirograph patterns with parametric equations and the turtle module, simulating cellular automata with Conway's Game of Life, synthesizing the overtones of plucked instruments with the Karplus-Strong algorithm, simulating flocking with a boids model; converting images into ASCII art, making photo mosaics, and generating autostereograms; drawing 3D graphics and particle systems with OpenGL and shaders, and visualizing CT and MRI scan data as 3D images through volume rendering; finally, extending programs to electronic hardware via Arduino and Raspberry Pi to build a music-reactive laser show and a Raspberry Pi-based weather monitor. Each project begins by breaking down the problem, introduces the necessary mathematical background and library interfaces, then gives complete code and run instructions, ending with suggestions for further experiments. The book suits readers who want to move from "knowing syntax" to "making things," and can serve as a project workbook and source of creative inspiration. A 2nd edition appeared in 2024, using Python 3.9 and shifting entirely to the Raspberry Pi.

Editor's review

很多 Python 学习者卡在同一个坎上:语法都懂,却不知道该拿它做什么。这本书正是为跨过这道坎而写。它不重复讲变量、循环和类,而是直接抛出一个个让人手痒的项目:画万花尺、让生命游戏在终端里演化、把照片拼成马赛克、用 CT 数据渲染出三维人体,最后把代码接到 Arduino 和树莓派上,做一台随音乐跳动的激光秀。 本书的难得之处在于“讲透”。作者是有着二十多年经验的图形学与嵌入式顾问,每个项目都先交代数学与算法思路,再逐段拆解代码,最后留出延伸实验,读者不是照抄,而是真正理解问题是怎么被拆成步骤、再用 Python 一步步解决的。项目难度呈阶梯分布,前几章热身后逐步进入 OpenGL 着色器与体渲染,做完一遍,对 NumPy、Matplotlib、Pygame、PIL 这些库的掌握会远超读一本工具手册。 需要提醒的是,书中硬件部分基于 Arduino 与树莓派,环境与库版本相对较早;若你更希望使用 Python 3.9 以上版本和树莓派 Pico,可考虑 2024 年出版的第 2 版。无论如何,这本书更像一本可以反复翻的工作台手册,而不是读完就束之高阁的教程。

Who it's for

A good fit for

  • 已掌握 Python 基本语法、想做点真实项目的学习者
  • 喜欢图形、音乐、模拟与可视化等创意编程方向的读者
  • 希望用 Python 接触 Arduino、树莓派等硬件的爱好者
  • 需要项目案例用于教学或社团活动的老师与组织者

Not a good fit for

  • 完全零基础、尚不清楚变量与函数的读者
  • 只想系统学习 Python 语法与语言细节的备考型读者
  • 期待直接获取框架级 Web 或数据分析工程实践的读者

Reading tips

  1. 先跑通附录A的环境安装,把随书代码仓库克隆下来,边读边改。
  2. 按五个部分循序推进;时间有限时可先做第2、3、6、8章这四个门槛较低的项目。
  3. 每章末的“实验”建议不要跳过,改参数、换数据是理解算法最快的方式。
  4. 硬件部分先确认手头板子型号,第2版已全面转向树莓派,注意版本差异。

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 I: Warming Up
  2. Chapter 1: Parsing iTunes Playlists
  3. Chapter 2: Spirographs
  4. Part II: Simulating Life
  5. Chapter 3: Conway's Game of Life
  6. Chapter 4: Musical Overtones with the Karplus-Strong Algorithm
  7. Chapter 5: Boids: Simulating a Flock of Birds
  8. Part III: Fun with Images
  9. Chapter 6: ASCII Text Graphics
  10. Chapter 7: Photo Mosaics
  11. Chapter 8: Autostereograms
  12. Part IV: Entering the Third Dimension
  13. Chapter 9: Understanding OpenGL
  14. Chapter 10: Particle Systems
  15. Chapter 11: Volume Rendering
  16. Part V: Playing with Hardware
  17. Chapter 12: Introduction to Arduino
  18. Chapter 13: Laser Music Show
  19. Chapter 14: A Raspberry Pi-Based Weather Monitor
  20. Appendix A: Software Installation
  21. Appendix B: Basic Practical Electronics
  22. Appendix C: Tips and Tricks for the Raspberry Pi

FAQ

这本书适合零基础学 Python 吗?
不太适合。作者在开篇就说明本书不教 Python 基础语法,默认读者已了解变量、函数、类等概念。零基础读者建议先读完一本入门教程,再回来用它做项目练习。
第一版和第二版有什么区别?
第2版于2024年由袁国忠翻译出版,ISBN 为 9787115642363,改用 Python 3.9,共15个项目,新增科赫雪花、圆环面上的生命游戏、树莓派 Pico 与音频机器学习等内容,并全面转向树莓派,不再涉及 Arduino。
书中的代码还能正常运行吗?
核心算法与 Python 库用法基本通用,但第一版出版于2017年,部分库版本与安装步骤已过时,尤其是 Pygame、PyOpenGL 与硬件相关部分,建议按官方仓库的说明配置环境或参考第2版。
没有硬件能做书里的项目吗?
可以。前四部分的图形、模拟与三维渲染项目全部在电脑上完成,占全书大部分篇幅;第五部分的 Arduino 与树莓派项目可先读思路,等有板子再动手。

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.

More by the same author

Top rated in the same category