Creative Python Programming cover

Creative Python Programming

Rating 4.4
Word count
253K words
Chapters
18
ISBN
9787115551757

Tags

Summary

Creative Python Programming is an introductory book for programming beginners by Tong Jing, associate professor in the Department of Computer Science at Hohai University, published by Posts & Telecom Press in January 2021. The book has 16 chapters plus two appendices, built around 15 interactive artworks each under 100 lines of code, linking Python syntax with the creative programming tool Processing. There is no chapter devoted to grammar in isolation; instead, starting from Chapter 2, a round face with rolling eyes introduces integers, variables and arithmetic operators; hypnotic concentric circles introduce the for loop, integer division and modulo; rotating arcs introduce if conditionals, comparison and logical operators; and chapters such as simple brush calligraphy, rotating squares, randomly wriggling curves, drifting particles, interacting balls and random landscape painting gradually introduce type conversion, nested loops, string handling, random functions, lists, function definition and parameters, recursion, and classes and objects. Chapters 13 to 15 extend to image pixel sampling, custom character art and music visualization, briefly covering RGB and HSB color models and basic image processing concepts; Chapter 16, Hold On for a Hundred Seconds, uses a webcam and face detection so head movements steer a flying saucer, integrating the whole book into one motion-sensing game. Each chapter breaks its example into steps—run first, then understand, then modify—with exercises at the end, answers in Appendix A and an index of concepts and syntax in Appendix B. The book includes full code, image and music assets, demo videos and full-color printing, suitable both for self-study from scratch and for secondary school or university courses in interactive art or programming.

Editor's review

大多数人学编程失败,原因在于看不到自己的代码在干什么。这本书选择另一条路:每一章都从一个能用眼睛直接看到、用鼠标直接玩到的效果开始,比如先画一个圆,再让圆的眼珠跟着鼠标转,最后拼出一张会动的“圆脸”。语法就在“想让它再多转一点”的欲望里被逐步引进,变量、循环、条件判断、函数、递归、面向对象,都是解决问题时自然要用到的东西,而不是先背完再想办法用。 三个特点值得留意。其一,代码极短。全书案例都不超过100行,初学者不至于被长代码吓退,也不需要先理解一整套工程结构才能看到效果。其二,作者有15年一线编程教学经验,案例的难度顺序经过了课堂检验,每章末尾都配练习题和参考答案,便于自学时确认自己有没有真的掌握。其三,案例本身有审美,随机山水画、分形树、字符画、音乐可视化都是可以拿出去“炫”的作品,很容易激发继续改造的动力。 配套的源码、素材和演示视频可以下载,跟着做基本不会卡在环境配置上。如果你想要一本不像教材的Python入门书,把它放在桌边最合适。

Who it's for

A good fit for

  • 完全没有编程基础、想通过“看得见的效果”入门Python的读者
  • 对互动艺术、创意编程、Processing可视化感兴趣的中学与大学生
  • 需要一本案例可复现的教材或选修课配套读物的老师
  • 会一点语法但只会写命令行练习、缺少作品感的学习者

Not a good fit for

  • 已有较扎实Python基础、希望深入数据科学或后端开发的中高级读者
  • 想做爬虫、数据分析、机器学习等实用性项目的人
  • 期待系统、完整语法体系参考手册的读者

Reading tips

  1. 务必先按第1章配置好Processing与Python模式,环境跑通再往后读,否则后面会反复卡住。
  2. 每章先运行配套源码看效果,再关掉代码自己重写一遍,遇到卡点再回头对照,比重读讲解更有效。
  3. 把每章末尾的练习题当作必做项,并尝试修改参数、颜色或交互方式,做出属于自己的变体作品。
  4. 建议按章顺序推进,每周完成2至3章,第16章“坚持一百秒”留到最后一口气整合运用全书知识。

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. Chapter 1 Introduction to Python and Processing
  2. Chapter 2 The Round Face with Rolling Eyes
  3. Chapter 3 Hypnotic Concentric Circles
  4. Chapter 4 Rotating Arcs
  5. Chapter 5 Simple Brush Calligraphy
  6. Chapter 6 Rotating Squares
  7. Chapter 7 Randomly Wriggling Curves
  8. Chapter 8 Particles Drifting in the Wind
  9. Chapter 9 Interacting Balls
  10. Chapter 10 Random Landscape Painting
  11. Chapter 11 Recursive Fractal Trees
  12. Chapter 12 Concentric Particle Circles
  13. Chapter 13 Image Pixel Sampling
  14. Chapter 14 Custom Character Art
  15. Chapter 15 Music Visualization
  16. Chapter 16 Hold On for a Hundred Seconds
  17. Appendix A Answers to Exercises
  18. Appendix B Index of Syntax and Concepts

FAQ

这本书和《Python游戏趣味编程》是同一本书吗?
不是。两书作者同为童晶,也都由人民邮电出版社出版,但《Python游戏趣味编程》以12个游戏案例为主,ISBN为9787115538246;本书以15个互动艺术案例为主,ISBN为9787115551757,内容与章节安排都不同。
零基础、没学过任何编程能看懂吗?
可以。本书从画一个圆、定义第一个变量讲起,语法知识随案例引入,所有案例代码不超过100行,适合没有编程经验的读者按章推进,但需要读者愿意动手敲代码,而不只是阅读。
书里的案例需要额外装什么软件?
主要使用Python与Processing的Python模式(书中第1章有下载与配置说明),后期涉及音乐与视频会用到Minim音频库以及摄像头调用,配套的代码、图片与音乐素材可在出版社配套页面下载。
书里的代码会过时吗?
示例基于Processing的Python模式,属于较为稳定的创意编程环境,核心语法与绘图思路不易过时;但新版本Processing或Python在安装方式、库调用上可能有细微变化,遇到问题时优先参考配套资源与官方文档。
适合当作中学或大学课程教材吗?
适合。全书16章按难度递进,每章有小结与练习题,附录A提供参考答案、附录B提供语法索引,内容体量大致对应一个学期的互动艺术或程序设计入门课程,也可作为参考教材使用。

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.

About the author

童晶 Author

Tong Jing is an author whose writing focuses mainly on making programming accessible to a general readership. Public information about the author is limited, and the only confirmed work is Python Game Programming for Fun. Judging from its title and subject, the book belongs to the programming and design category and aims to introduce readers to Python through games, a concrete and engaging application. Rather than listing grammar points in the manner of a conventional primer, it emphasizes learning by doing, so that learners grasp basic concepts such as variables, loops, and conditionals while building small games, and gradually develop the ability to turn ideas into runnable code. On the available evidence, Tong Jing's approach combines practice with enjoyment and seeks to lower the barrier for beginners, keeping programming study from becoming dull. As only one work is held in the collection, a fuller picture of the author's writing and influence awaits further material.

More by the same author

Top rated in the same category