Crane
Table_bottom

Search
Loading
Table_bottom

分类
Table_bottom

随机文章
Table_bottom

标签云
Table_bottom

最新评论
Table_bottom

链接
Table_bottom

功能
Table_bottom

python的一个彩蛋

Crane posted @ 2010年9月23日 01:37 in Programing with tags linux python program , 10919 阅读

今天才知道python居然还有这样一个有意思的彩蛋,使用下面这一句python代码就可以看到。


import this

执行就可以看到一段关于python理念(禅?)的介绍。

 

The Zen of Python, by Tim Peters

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!

话说程序员都是有意思的存在,时常了解一些这样的彩蛋,还是挺有乐趣的事儿!

Firm 说:
2010年11月20日 06:00

程序员有时也蛮有情趣的

llhuii 说:
2012年11月18日 14:41

前几天还看到另外两个有意思:
import antigravity
from __future__ import braces

Avatar_small
Crane 说:
2013年2月27日 20:43

@llhuii: 我这没看到这个有什么效果


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter