# 打算每天多动的时候尽量搜索一些和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. XE6 & IOS开发之开发者账号、苹果证书(2):关于苹果证书

    网上能找到的关于Delphi XE系列的移动开发的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 1.关于苹果证书. 注意 ...

  2. EF4.1使用

    EF分为三类: db first:首先建立数据库,然后通过ADO.Net Entity Data Model项目建立.edmx文件,这是一个xml文件主要作用就是映射类和数据表 model first ...

  3. firebug常用工具

    1.console.group("第一组"); console.log(1); console.groupend(); 2.console.dir(对象);//输出对象的所有信息 ...

  4. SQL Server 2008数据库日志收缩

    GO ALTER DATABASE MCS SET RECOVERY SIMPLE--设置简单恢复模式 GO DBCC SHRINKFILE (MCS_Log, 1) GO ALTER DATABAS ...

  5. MongoDB中insert方法、update方法、save方法简单对比

    MongoDB中insert方法.update方法.save方法简单对比 1.update方法 该方法用于更新数据,是对文档中的数据进行更新,改变则更新,没改变则不变. 2.insert方法 该方法用 ...

  6. Spark Streaming架构设计和运行机制总结

    本期内容 : Spark Streaming中的架构设计和运行机制 Spark Streaming深度思考 Spark Streaming的本质就是在RDD基础之上加上Time ,由Time不断的运行 ...

  7. 登录框密码框input框禁止复制、粘贴、剪切和右键功能

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. 解压版mysql安装

    步骤如下: 1.下载安装包 2.在环境变量中配置安装包的bin路径 3.修改安装包下的my-default.ini. 修改basedir和datadir的值为解压文件对应的路径,port和 serve ...

  9. 1219 spring3 项目总结

    Spring3 项目总结 列志华 (组长) http://www.cnblogs.com/liezhihua/ 团队guihub https://github.com/LWHTF/OrderingFo ...

  10. 3、C#面向对象:封装、继承、多态、String、集合、文件(下)

    面向对象多态 一.装箱和拆箱 装箱:将值类型转换为引用类型.object o = 1:值类型给引用类型赋值 拆箱:将引用类型转换为值类型.int n = (int)o; 强制转换为值类型 满足条件:两 ...