1 s" s8 ~. D& U估计每个 Python 人儿都知道 Python 之禅,不知道也没事,就是下面这个东西:. K! M) X4 J+ q1 U
5 a8 b$ j! P( l7 L) o# _6 q" @8 _; h # ?9 u( u+ |, ]$ e8 S' y>>> import this 2 [ v H6 D( k, X" n2 ~) B1" ~: X, U- U( w1 g s9 V3 C( F
1 O3 H* _/ c& |2 l4 }
一键回车:4 r) x( B% W% i8 V! _" t: \" M; V
" q. D9 {) g9 ?
- U. |- i: S+ N$ O% v' `0 e, r
The Zen of Python, by Tim Peters / M! g* a z; {7 A$ ~& @. W. l6 @# i! g" b
Beautiful is better than ugly.* g; {+ P2 T, M
Explicit is better than implicit. # F$ t8 U. M& v- x( S9 \9 K NSimple is better than complex.) w) D& j, f6 D" q
Complex is better than complicated. / b( v1 g& V" Z4 ^" G# v* xFlat is better than nested.; @( Y9 G: \( S' J [
Sparse is better than dense. ) ^" i1 d0 r5 ?' p2 h& R# `8 }Readability counts.8 N7 r& A4 [2 M" L# D
Special cases aren't special enough to break the rules.6 D# J y; a& l3 ?
Although practicality beats purity./ C, y8 f* q2 h8 t8 u; x, j+ [
Errors should never pass silently.; ~ x4 Q# O) U& Q( S" M
Unless explicitly silenced. . k& ~2 M+ m7 z; X* Z' j" a0 u' }In the face of ambiguity, refuse the temptation to guess. 7 r8 Z' }5 T) HThere should be one-- and preferably only one --obvious way to do it. - t/ { v' J7 k5 s k% hAlthough that way may not be obvious at first unless you're Dutch. - ], b5 G! |8 h" B# c7 FNow is better than never.6 i" b, H' y4 u! x' ^. B O- j. h
Although never is often better than *right* now. & r; J6 a- r. QIf the implementation is hard to explain, it's a bad idea.! o4 ]* u; S. G$ a5 ~
If the implementation is easy to explain, it may be a good idea. & e8 f1 Q @/ o9 o$ qNamespaces are one honking great idea -- let's do more of those!5 d: _9 j6 l& n! `5 t, B9 h: n
F( w# x2 k% D" o具体翻译如下: # M" @) Q7 j/ w9 P1 O9 t * L7 ?" C- S& s0 k0 P4 y+ d* U : R# I8 ]. i. _1 x5 Z0 [0 ?好好学习 , H$ k/ E2 r* G+ d' S天天向上 8 t: T, Q- q2 ^" w% e9 u* }, w. e2 l
( e0 }7 c' }3 d v8 z. y/ R* _ : w- N. [6 s: C. g! V . r1 h3 a. b5 t S8 |3 uthis 是什么?6 H4 h$ f0 a5 }5 e# ]( K% l
经过我的剽窃,啊不,参考…8 b; t7 Q5 z- r9 \1 ^: j% S0 l7 m0 `
this 是爱啊…/ [2 q+ b% c/ [' h+ N# b
" j9 @9 u/ z! E# G" q
& V" i5 @6 v+ E* n; @>>> love = this( p8 Z, A0 d+ @1 p' R
>>> this is love" N% |9 p$ ^$ m# _
True & k( |8 S c0 L- m" _& V0 A. n, ]( H7 v7 k, J7 K! A2 `9 W# d7 p
, P+ Y% t" H9 S$ S那爱是什么? L K5 Z. e' V! a. z# I- y! y( Y- a, I- N4 D9 _: a7 _: B2 _
' C* L1 U( B; W
爱是你我~ K2 B i8 w% B: ~! U0 `9 `7 o用心交织的生活~7 X2 F! x4 F$ _3 J
/ \( u4 K- C" d5 n4 P 1 n/ J. N! ?! P5 R" V- Z8 p' L ( J% C* |# E+ p4 w$ }( v7 e |- b4 V
错了! 9 |2 u" k# P! S1 j% s: H3 W真理告诉我们真理是: ' C7 T% C& h5 B7 L# S/ V ! n; v1 }9 J* \, n( e! ^) n6 R" _9 _4 I1 z4 L( q0 Q$ r
>>> love is True . F1 v8 x( C2 T H# M/ TFalse ; G/ ]5 r) a* [& {3 l% r X7 F! U>>> love is False$ h7 U3 d7 f% R c! I5 C9 y9 G% |
False + v* j7 I8 k. Q/ }>>> love is not True or False* Y. ?8 w1 W1 k1 c, v
True1 M( `$ }% Y6 T+ M5 C0 _
>>> love is love. ~6 n" m: L, P# q/ v
True 5 {# n; H# Q: b! A$ U% |1 U" t" x! t! @; b