Python的设计哲学--zen of Python

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.虽然这种 方式可能不容易,除非你是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 之禅,Guido van Rossum一定是个有趣的人,能将设计思想展现在python解释器中,在“hello world”程序开始之前,它还有一番人生哲学啊

Python的设计哲学--zen of Python的更多相关文章

  1. Python的设计哲学探究

    在Python shell中输入import this就会在屏幕上打印出来Python的设计哲学,如下: In [25]: import this The Zen of Python, by Tim ...

  2. Python的设计哲学

    Beautiful is better than ugly. 优美胜于丑陋 Explicit is better than implicit. 明了胜于晦涩 Simple is better than ...

  3. Python基础教程(004)--Python的设计哲学

    前言 Python已经成为了一门流行的编程语言. 知识点 1,优雅 2,明确 3,简单 Python开发者的哲学是:用一种方法,最好是只有一种方法来做一件事. 如果面临多种选择,Python开发者都会 ...

  4. python之禅 the zen of python

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

  5. Python import this : The Zen of Python

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

  6. 什么是Python?Python的设计哲学?如何获取/升级Python?

    Python? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/) Python的创始人为吉多·范罗苏姆(Guido van Rossum). 1989年的圣诞节期间,吉多· ...

  7. funny_python 00 The Zen of Python

    # 打算每天多动的时候尽量搜索一些和coding相关的funny stuff Day 00 - PEP 20 The Zen of Python 在shell里面输入python -m this 回车 ...

  8. 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 ...

  9. ######【Python】【基础知识】Python的介绍 ######

    Python 是一种面向对象.解释型计算机程序设计语言. Python是什么? Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈpaɪθɑːn/), 是一种面向对象的解释型计算机程序设计语言 ...

随机推荐

  1. charles代理设置与数据劫持

    1.安装charles,点击帮助——ssl代理——在移动设备或远程浏览器上安装charles root证书,看到如下界面: 2.在手机保证和电脑连接同一个wifi的前提下,开启手机代理,输入服务器地址 ...

  2. Python中创建虚拟环境(virtualenv模块)

    针对环境:win7,python2.7 需要virtualenv模块1.测试是否已安装virtualenv模块    import virtualenv  #没有报错则已安装    否则需要先安装vi ...

  3. mysql数据库之忘记root密码

    1.  vi /etc/my.cnf,在[mysqld]中添加 skip-grant-tables 例如: [mysqld] skip-grant-tables datadir=/var/lib/my ...

  4. kerberos&LDAP实现免密码登录搭建

    kerberos && openldap 1.install openldap & kerberos server: yum install db4 db4-utils db4 ...

  5. linux(03)基础系统优化

    Linux之基础系统优化 Linux基础系统优化 >>> https://www.cnblogs.com/pyyu/p/9355477.html Linux的网络功能相当强悍,一时之 ...

  6. 201871010117-石欣钰《面向对象程序设计(java)》第七周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  7. WIN10安装64位JDK10.0.2详细完整教程(图文)

    1.下载JDK 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 1)如下图,点击红色箭头处: 2)如下图 ...

  8. (day48作业)jQuery+Bootstrap练习题

    目录 一.图书管理系统页面搭建 二.jQuery练习题 一.图书管理系统页面搭建 <!DOCTYPE html> <html lang="en"> < ...

  9. 《Ensemble Methods: Foundations and Algorithms》

    <Ensemble Methods: Foundations and Algorithms>

  10. zz深度学习目标检测2014至201901综述

    论文学习-深度学习目标检测2014至201901综述-Deep Learning for Generic Object Detection A Survey  发表于 2019-02-14 |  更新 ...