人生苦短,我用Python

简介: Python 设计哲学打开控制台,进入python交互环境,输入import this,我们就能看到这样一段话。Python 之禅 --- by Tim PetersPython 2.

Python 设计哲学

打开控制台,进入python交互环境,输入import this,我们就能看到这样一段话。
Python 之禅 --- by Tim Peters

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import 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!
>>> 

本文希望学习Python的读者牢记这段话,作为未来我们开发Python程序的原则。

目录
相关文章
Python学习笔记183
Python 日期和时间
|
人工智能 Python
Python学习笔记491
Python 练习实例
Python学习笔记379
Python SMTP发送邮件
|
缓存 中间件
Python3.6学习笔记(六)
WSGI Python Web Server Gateway Interface 规范学习 由于Python的灵活性,提供了多种方式可以作为服务端语言,包括Python编写的服务器(Medusa)、Python处理模块(mod_python),或者使用CGI、FastCGI方式触发Python脚本。
1202 0
Python学习笔记176
Python 日期和时间
Python学习笔记310
Python 正则表达式
Python学习笔记165
Python 字典(Dictionary)
Python学习笔记49
Python 条件语句

热门文章

最新文章