# 打算每天多动的时候尽量搜索一些和coding相关的funny stuff

Day 00 - PEP 20 The Zen of Python

在shell里面输入python -m this 回车,可以欣赏到Tim Peters 的The Zen of Python

除此之外,还可以通过import this 来获取这段文字

好奇的瓦还试了import that等其他看起来类似的但明显没可能再有好玩儿的事情发生的关键字,果然没有内容。

机智的我找到了this.py的源码(算是一个复活节彩蛋了),代码如下:

 s = """Gur Mra bs Clguba, ol Gvz Crgref

 Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+13) % 26 + c) print("".join([d.get(c, c) for c in s]))

实际输出结果:

C:\Users\Naomi>python -m this
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! C:\Users\Naomi>

搜索的时候还发现了一个python humor列表,还没有深入研究,不过看起来应该很有意思的样子。想什么呢,python (Monty Python's Flying Circus) 原本就是非常有意思的啊!

那就请继续探索python humor吧!Animo~!

References:

PEP 20 -- The Zen of Python 官方文档

https://www.python.org/dev/peps/pep-0020/

维基百科The Zen of Python

https://en.wikipedia.org/wiki/Zen_of_Python

funny_python 00 The Zen of Python的更多相关文章

  1. Zen of Python

    Zen of Python $ python Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit ...

  2. python之禅 the zen of python

    >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is ...

  3. Python import this : The Zen of Python

    >>> import thisThe Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is b ...

  4. Python彩蛋--zen of python

    今天早上在公交上浏览博客的时候,发现了python里面的一个小彩蛋--zen of python 一首python之歌 我们来看一看... ​ 是不是很简单,在python shell 里 输入 im ...

  5. Zen of Python(Python的19条哲学)

    The Zen of Python Beautiful is better than ugly. Explicit is better than implicit. Simple is better ...

  6. 趣闻|Python之禅(The Zen of Python)

    在Python解释器中输入“import this”会发生什么?如果你不知道这个彩蛋,推荐继续阅读这篇文章. 2001年秋,Foretec(一家会议组织公司)正在准备召开第十届Internationa ...

  7. Python的设计哲学--zen of Python

               Python的设计哲学--zen of Python Beautiful is better than ugly. 优美胜于丑陋 Explicit is better than ...

  8. Import This - The Zen of Python

    The Zen of Python -- by Tim Peters Beautiful is better than ugly.Explicit is better than implicit.Si ...

  9. Go for Pythonistas Go and the Zen of Python 禅

    Go for Pythonistas https://talks.golang.org/2013/go4python.slide#1 Things I don't like about Python ...

随机推荐

  1. stickUp让页面元素“固定”位置

    stickUp能让页面目标元素“固定”在浏览器窗口的顶部,即便页面在滚动,目标元素仍然能出现在设定的位置. http://www.bootcss.com/p/stickup/

  2. c++学习--面向对象一

    类与对象一 一 注意的点 1 利用构造函数给数据成员初始化的两种办法:1 赋值语句,2 用成员初始化列表 解释:1 成员初始化列表的一般形式为: 数据成员名1(初始值1),数据成员名2(初始值2) 2 ...

  3. printf()输出

    printf()函数是式样化输出函数, 一般用于向准则输出设备按规定式样输出消息.正在编写步骤时经常会用到此函数.printf()函数的挪用式样为: printf("<式样化字符串&g ...

  4. smb:unrecognized service

    [root@sycflash ~]#service smb status smb:unrecognized service 提示:smb:unrecognized service.这时你会按照常规的方 ...

  5. hadoop 日志分析

    1:在每一个tomcat服务器上,生成的日志目录中,在java中用定时器每天将当天的日志上传到hadoop中 (技术要点:quatz+hadoop-client)具体的目录动态的采用时间品名 2:ha ...

  6. HsqlDB Demo

    import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sq ...

  7. 古诗词api,诗词接口,诗词api,中国诗词

    服务商:api.getlove.cn 分类:诗词 更新时间:2016-03 如果接口不满足您的要求,您可以联系qq:2265658022购买完整的数据库 免费apikey:56eab527a0facb ...

  8. leetcode-【中等题】3. Longest Substring Without Repeating Characters

    题目: Given a string, find the length of the longest substring without repeating characters. Examples: ...

  9. 用world写blog

    一级目录 怎么写呢? 这个和markdown那个更加方便呢? 据说插入表格有问题 我试一试         二级目录 这个大小还不错 添加第三季目录呢 三级目录 添加目录必须要用鼠标么? #inclu ...

  10. javascript 字符串数组链接

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...