The Zen of Python —— Python 之禅
- Beautiful is better than ugly. # 优美好于丑陋(Python以编写优美的代码为目标)
- 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. # 虽然那种方法一开始可能并不明显,除非你是 Dutch(Python 之父)
- 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! # 命名空间是个绝妙的主意,让我们做更多这样的事
注:在 Python 的交互式解释器中输入 import this 就可以查阅到上述文档。
The Zen of Python —— Python 之禅的更多相关文章
- python --- Python中的callable 函数
python --- Python中的callable 函数 转自: http://archive.cnblogs.com/a/1798319/ Python中的callable 函数 callabl ...
- Micro Python - Python for microcontrollers
Micro Python - Python for microcontrollers MicroPython
- 从Scratch到Python——python turtle 一种比pygame更加简洁的实现
从Scratch到Python--python turtle 一种比pygame更加简洁的实现 现在很多学校都开设了Scratch课程,学生可以利用Scratch创作丰富的作品,然而Scratch之后 ...
- 从Scratch到Python——Python生成二维码
# Python利用pyqrcode模块生成二维码 import pyqrcode import sys number = pyqrcode.create('从Scratch到Python--Pyth ...
- [Python]Python 使用 for 循环的小例子
[Python]Python 使用 for 循环的小例子: In [7]: for i in range(5): ...: print "xxxx" ...: print &quo ...
- [python]python 遍历一个list 的小例子:
[python]python 遍历一个list 的小例子: mlist=["aaa","bbb","ccc"]for ss in enume ...
- [Python]Python日期格式和字符串格式相互转换
由字符串格式转化为日期格式的函数为: datetime.datetime.strptime() 由日期格式转化为字符串格式的函数为: datetime.datetime.strftime() # en ...
- [python]Python 字典(Dictionary) update()方法
update() 函数把字典dict2的键/值对更新到dict里.如果后面的键有重复的会覆盖前面的语法dict.update(dict2) dict = {'Name': 'Zara', 'Age': ...
- python编程之禅
在python界面输入 import this >>> import this The Zen of Python, by Tim Peters Beautiful is bette ...
随机推荐
- 【NS2】NS2修改MAC协议(转载)
NS2版本:2.34 涉及NS2代码文件: ns-2.34/mac/channel.h ns-2.34/mac/channel.cc ns-2.34/mac/wireless-phyExt.h n ...
- 2019-10-22-Roslyn-打包自定义的文件到-NuGet-包
title author date CreateTime categories Roslyn 打包自定义的文件到 NuGet 包 lindexi 2019-10-22 19:45:34 +0800 2 ...
- GP-荧光免疫分析仪SDK 协议
近期,闲来无事,得到一款GP的poct设备研究了下,该设备型号:Getein1100 ,串口进行通信,但是串口连接有所限制,于是找到一款数传模块,将串口转网口,使用pc进行通信抓包分析,如下: 在此可 ...
- [翻译]Python中yield的解释
问题: Python中yield关键字的作用是什么?它做了什么? 例如,我想理解以下代码 def node._get_child_candidates(self, distance, min_dist ...
- H3C 命令级别
- tinyhttpd简介
一:简介: tinyhttpd是由J. DavidBlackstone在1999年编写的,实现了一个很简单的web服务器.支持GET和POST方法,总代码量也就在500行左右,可以用来学习HTTP协议 ...
- rdlc报表部署
1)在D盘创建目录ReportViewer 2)打开运行界面,运行如下的执行 copy C:\Windows\assembly\gac_msil\Microsoft.ReportViewer.Comm ...
- [转]FileDescriptor详解
FileDescriptor是"文件描述符". FileDescriptor可以被用来表示开放的文件,开放的套接字等. 当FileDescriptor表示文件来说,当FIleDes ...
- H3C NAT组网和常用术语
- java 标准流
标准输入流: System.in 默认表示的是键盘录入 标准输出流: System.out 默认表示的是屏幕输出 Eg: package june6D; import java.io. ...