) }5 t5 k. j: i2 ]* ^6 ? 5 s) }4 l" C; H2 P" ?# P g$ } a% H N7 c, @6 d
就是上面这个图… 5 F# n x+ V5 o. L0 M# M; b真的是搞笑,都是英文,我怎么看的懂嘛… 6 H5 D+ j+ G) ^# G% \, \一键翻译… + N- K1 W) j% m/ l# O( ^8 h9 S # F5 g* {( `( {$ C" D7 W7 I x7 w! h0 O
奥,这个我知道,不就是说 Python 语法简单,功能牛批么…, E$ H( k! R- L. U
果然是…直接。! p/ l9 w) _( S. _% |
& `# K: N6 X, b* G
% {" y8 P/ ^, j# x* x" S+ J1 T: j; v& }* w 4 S( k/ R& [# u/ K0 U & n' G; H4 [# G 3 w! h0 R) `2 v& x7 b* E$ K D6 {5 _. d$ P; f1 b( v+ f |4 b
0x04 爱是什么? 1 L3 {. a% j" _. v3 ]* S8 q1 h% j% `" r. }0 t7 U. y
% y. p# M0 ?# G4 r* u" O
估计每个 Python 人儿都知道 Python 之禅,不知道也没事,就是下面这个东西: 8 Y$ d" l+ z3 ]! `1 h/ Q- E% s5 K+ `! F4 O$ w) \
! M2 T/ T; ~, |>>> import this - X5 N8 D) K. Q- V+ b) H& F& a1 + h( J; a# p. d) f" ~4 ~7 Q / D3 `( A* m& U, z9 C) y一键回车:6 z/ n& t' P( q- O, E( ]% p
9 w% I& ?* t, B7 I6 o9 q
$ q; A/ s* T1 f; N$ J" @3 M' E0 W
The Zen of Python, by Tim Peters4 V- `8 q2 |/ I- N% i( L
7 N/ Z' E) O' s9 ^$ o4 q3 g4 o! L7 I9 M
Beautiful is better than ugly.- ?% C; L5 T7 H7 q5 o$ U3 \* f
Explicit is better than implicit. 1 C$ r" N8 _, k2 _" F/ d; MSimple is better than complex. ) L( ~ }& \, o+ vComplex is better than complicated.6 R7 c$ Q6 B( g m0 V
Flat is better than nested.# K- Z* @! h6 Q
Sparse is better than dense. : H$ e/ P0 ]8 n8 O$ oReadability counts.3 d4 e9 y5 Y) @
Special cases aren't special enough to break the rules. Q+ x/ s8 p! q. t; j7 sAlthough practicality beats purity. " e% v- d, p; \) r- I t0 _% v# e5 wErrors should never pass silently. 3 B$ H6 j0 t8 E: r+ [Unless explicitly silenced. 1 f4 K- F1 Z, @8 t$ z3 d5 C" KIn the face of ambiguity, refuse the temptation to guess. & _& N" s: Y3 o1 F& A* O6 G6 G( {% KThere should be one-- and preferably only one --obvious way to do it.0 }! g; N/ `9 |" }1 l. }" R8 u
Although that way may not be obvious at first unless you're Dutch.$ n( N& y4 ~6 M- X P& [
Now is better than never." C: z, R9 q- f9 C% z" `0 u
Although never is often better than *right* now.5 f8 T" A, |+ z; U* g
If the implementation is hard to explain, it's a bad idea. 7 M6 R$ x8 K+ D/ h) e. X+ O2 c$ E1 kIf the implementation is easy to explain, it may be a good idea. ; V; \" e- J, h7 \! h1 ANamespaces are one honking great idea -- let's do more of those!( |; i: ^8 q; W
& E8 U# }; R9 x7 F5 s
具体翻译如下: . [* }1 g8 c5 R# V( A+ T8 @% F. V p0 }* p8 T# f, R8 \. O# h
( {4 J2 I, L+ ?. V7 M$ V2 Y9 t
好好学习6 V2 N4 o7 _0 S9 E8 H8 |
天天向上 7 _9 E8 w9 O4 m, G: v5 Z0 C; p3 p5 Q0 w( @- q9 I! S
4 s( [9 [+ h; y1 x+ @# O' N0 V& D; d9 T. o3 y6 O0 Y
, p6 s( g* u3 M1 v+ Z
this 是什么? ) C: s( h9 v/ P+ I' a经过我的剽窃,啊不,参考…" [ S& i( W; w g* N" C0 F; B- _% n
this 是爱啊…- ^1 a" q( J7 `' {2 u/ o
3 w w+ x4 K+ I& z: N' k. ]: t- b, M" t6 v5 X: b8 {" Q
>>> love = this$ F( o, J/ [4 [, g
>>> this is love0 \% r' f# L7 l9 {; K4 X2 ]
True2 U1 t+ g4 K o: E0 {9 F" N& f
, |- }0 H! ?: M# d3 } H% s
7 w6 p- y \4 E! G; C3 T% C
那爱是什么? ( P. P5 j* I' @% w 2 ?6 @5 r6 t% `4 W1 R- H% [/ M5 S% T, g, n! R2 [0 U/ F! i4 X
爱是你我~ " e. F( M/ g, i ]用心交织的生活~ ) Z s& s' n/ P$ ] 2 Y+ Z; G% y, \2 T8 U6 r5 ]2 P% Z( Y0 s5 l3 S. i" F/ ?