blob: 876987de7c025756d62c4247f1da959e226c1474 [file] [log] [blame]
Fred Drake2e1094e1999-04-09 14:53:35 +00001#! /usr/bin/env python
Guido van Rossumab3a2501994-08-01 12:18:36 +00002
3# This Python program sorts and reformats the table of keywords in ref2.tex
4
Guido van Rossumab3a2501994-08-01 12:18:36 +00005l = []
6try:
7 while 1:
Fred Drake071972e2002-10-16 15:30:17 +00008 l = l + raw_input().split()
Guido van Rossumab3a2501994-08-01 12:18:36 +00009except EOFError:
10 pass
11l.sort()
12for x in l[:]:
13 while l.count(x) > 1: l.remove(x)
14ncols = 5
15nrows = (len(l)+ncols-1)/ncols
16for i in range(nrows):
17 for j in range(i, len(l), nrows):
Fred Drake071972e2002-10-16 15:30:17 +000018 print l[j].ljust(10),
Guido van Rossumab3a2501994-08-01 12:18:36 +000019 print