Skip to content

Learn Python The Hard Way #4

microacup opened this Issue Mar 24, 2013 · 0 comments

1 participant


最近得知一个很好的在线学习Python等的网站: 中文名叫《笨办法学Python》

以动手实践为荣 , 以只看不练为耻;
以打印日志为荣 , 以单步跟踪为耻;
以空格缩进为荣 , 以制表缩进为耻;
以单元测试为荣 , 以人工测试为耻;

以模块复用为荣 , 以复制粘贴为耻;
以多态应用为荣 , 以分支判断为耻;
以Pythonic为荣 , 以冗余拖沓为耻;
以总结分享为荣 , 以跪求其解为耻;

何为“ Hard Way ”?有这么三点:

1. Go through each exercise.
2. Type in each sample exactly.
3. Make it run.



Do Not Copy-Paste!



import this

Beautiful is better than ugly. 
Explicit is better than implicit. 
Simple is better than complex. 
Complex is better than complicated. 
Flat is better than nested. 
Sparse is better than dense. 
Readability counts. 
Special cases aren’t special enough to break the rules. 
Although practicality beats purity. 
Errors should never pass silently. 
Unless explicitly silenced. 
In the face of ambiguity, refuse the temptation to guess. 
There should be one– and preferably only one –obvious way to do it. 
Although that way may not be obvious at first unless you’re Dutch. 
Now is better than never. 
Although never is often better than *right* now. 
If the implementation is hard to explain, it’s a bad idea. 
If the implementation is easy to explain, it may be a good idea. 
Namespaces are one honking great idea — let’s do more of those! 

– by Tim Peters

@microacup microacup was assigned Apr 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.