简评：这是的阅读完成的第二本python书籍，对于有一些编程经验的人来说这本书籍太过啰嗦了，不适合快速入门，和第一本（a byte of python）有太多重复的地方。但有个好处是练习特别多，一共52个。即使大多练习都比较简单，但通过自己一行一行的敲打，也会逐渐习惯这门语言。坦白的讲最后的几个Exercise我看的都比较粗糙，但确实是全书的亮点。作者从具体的一个游戏出发，教会你一步一步实现对问题的归纳整理，变成相应的类，再将类进一步分清层次，哪些可以变成基类，哪些可以继承。特别是对于游戏场景和地图的分析，可能就是大部分游戏的基本骨架（我没有编写大规模游戏的经验），最后作者通过代码实现基本的框架，然后重复这一个过程，一步一步细化整个程序。另外要说的一点是，作者对于很多初学者很难理解的知识点，都有很好的类比。比如：类和对象的概念，作者类比了一个例子，假设你有一个桶，桶里面装有三条Salmon，因为你爱给动物们起名字，于是你叫他们 Frank, Joe, and Mary现在请思考一个问题：What is the difference between Mary and a Salmon?这样一步一步带你去思考，而不是直接给你答案。久负盛名之下，必定有其经典的地方。
The world needs more weird people who know how things work and who love to ﬁgure it all out. When they treat you like this, just remember that this is your journey, not theirs. Being different is not a crime, and people who tell you it is are just jealous that you’ve picked up a skill they never in their wildest dreams could acquire.You can code. They cannot. That is pretty damn cool.
At fi rst, you will not understand anything. It’ll be weird, just like with learning any human language. You will struggle with words and not know what symbols are what, and it’ll all be very confusing. Then
one day—BANG—your brain will snap and you will suddenly “get it.” If you keep doing the exercises and keep trying to understand them, you will get it. You might not be a master coder, but you will at least understand how programming works.
An important concept that you have to understand is the difference between a object. The problem is, a class and anclthere is no real “difference” between as object and an . They are actually the same thing at different points in time. I will demonstrate by a Zen koan:
What is the difference between a Fish and a Salmon?
Did that question sort of confuse you? Really sit down and think about it for a minute. I mean, a Fish and a Salmon are different but, wait, they are the same thing, right? A Salmon is a kind of Fish, so I mean it’s not different. But at the same time, because a Salmon is a particular type of Fish,it’s actually different from all other Fish. That’s what makes it a Salmon and not a Halibut. So a Salmon and a Fish are the same but different. Weird.This question is confusing because most people do not think about real things this way, but they intuitively understand them. You do not need to think about the difference between a Fish and a Salmon because you know how they are related. You know a Salmon is a kind of Fish and that there are other kinds of Fish without having to understand that.
Let’s take it one step further: say you have a bucket full of three Salmon and, because you are a nice person, you have decided to name them Frank, Joe, and Mary. Now, think about this question:
What is the difference between Mary and a Salmon?
Again, this is a weird question, but it’s a bit easier than the Fish versus Salmon question. You know that Mary is a Salmon, and so she’s not really different. She’s just a specifi c “instance” of a Salmon. Joe and Frank are also instances of Salmon. What do I mean when I say “instance”? I mean they were created from some other Salmon and now represent a real thing that has Salmon- like attributes.
Now for the mind- bending idea: Fish is a class, and Salmon is a class, and Mary is an object. Think about that for a second. Alright let’s break it down real slow and see if you get it. A Fish is a class, meaning it’s not a real thing, but rather a word we attach to instances of things with similar attributes. Got fi ns? Got gills? Lives in water? Alright it’s probably a Fish. Someone with a PhD then comes along and says, “No, my young friend, this Fish is actually Salmo salar, affectionately known as a Salmon.” This professor has just clarifi ed the Fish further and made a new class called “Salmon” that has more specifi c attributes. Longer nose, reddish flesh, big, lives in the ocean or fresh water, tasty? OK, probably a Salmon.
1. Write or draw about the problem.
2. Extract key concepts from #1 and research them.
3. Create a class hierarchy and object map for the concepts.
4. Code the classes and a test to run them.
5. Repeat and refine
中文版、英文版和视频教程（包括：pdf epub mobi格式）