blob: 22c3bb850e5fad3ca7735ae79d2b1ea45e894b07 [file] [log] [blame]
Guido van Rossum4408ed51997-05-08 23:21:48 +00001"""Spit out the Python reserved words table."""
2
3import string
4
5raw_words = """
6and del for is raise
7assert elif from lambda return
8break else global not try
9class except if or while
10continue exec import pass
11def finally in print
12"""
13
14ncols = 5
15
16def main():
17 words = string.split(raw_words)
18 words.sort()
19 colwidth = 1 + max(map(len, words))
20 nwords = len(words)
21 nrows = (nwords + ncols - 1) / ncols
22 for irow in range(nrows):
23 for icol in range(ncols):
24 i = irow + icol * nrows
25 if 0 <= i < nwords:
26 word = words[i]
27 else:
28 word = ""
29 print "%-*s" % (colwidth, word),
30 print
31
32main()