File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1111WORD_RE = re .compile ('\w+' )
1212
1313index = {}
14- with open (sys . argv [ 1 ] , encoding = 'utf-8' ) as fp :
14+ with open ('zen.txt' , encoding = 'utf-8' ) as fp :
1515 for line_no , line in enumerate (fp , 1 ):
1616 for match in WORD_RE .finditer (line ):
1717 word = match .group ()
Original file line number Diff line number Diff line change 1212WORD_RE = re .compile ('\w+' )
1313
1414index = collections .defaultdict (list ) # <1>
15- with open (sys . argv [ 1 ] , encoding = 'utf-8' ) as fp :
15+ with open ('zen.txt' , encoding = 'utf-8' ) as fp :
1616 for line_no , line in enumerate (fp , 1 ):
1717 for match in WORD_RE .finditer (line ):
1818 word = match .group ()
Original file line number Diff line number Diff line change 1+ The Zen of Python, by Tim Peters
2+
3+ Beautiful is better than ugly.
4+ Explicit is better than implicit.
5+ Simple is better than complex.
6+ Complex is better than complicated.
7+ Flat is better than nested.
8+ Sparse is better than dense.
9+ Readability counts.
10+ Special cases aren't special enough to break the rules.
11+ Although practicality beats purity.
12+ Errors should never pass silently.
13+ Unless explicitly silenced.
14+ In the face of ambiguity, refuse the temptation to guess.
15+ There should be one-- and preferably only one --obvious way to do it.
16+ Although that way may not be obvious at first unless you're Dutch.
17+ Now is better than never.
18+ Although never is often better than *right* now.
19+ If the implementation is hard to explain, it's a bad idea.
20+ If the implementation is easy to explain, it may be a good idea.
21+ Namespaces are one honking great idea -- let's do more of those!
You can’t perform that action at this time.
0 commit comments