blob: f9e4b032b1eac06c6aba21d8400cc88fa6bf5024 [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
Neal Norwitzce96f692006-03-17 06:49:51 +00005def raw_input(prompt):
6 import sys
7 sys.stdout.write(prompt)
8 sys.stdout.flush()
9 return sys.stdin.readline()
10
Guido van Rossumab3a2501994-08-01 12:18:36 +000011l = []
12try:
Tim Peters3d7d3722004-07-18 06:25:50 +000013 while 1:
14 l = l + raw_input().split()
Guido van Rossumab3a2501994-08-01 12:18:36 +000015except EOFError:
Tim Peters3d7d3722004-07-18 06:25:50 +000016 pass
Guido van Rossumab3a2501994-08-01 12:18:36 +000017l.sort()
18for x in l[:]:
Tim Peters3d7d3722004-07-18 06:25:50 +000019 while l.count(x) > 1: l.remove(x)
Guido van Rossumab3a2501994-08-01 12:18:36 +000020ncols = 5
21nrows = (len(l)+ncols-1)/ncols
22for i in range(nrows):
Tim Peters3d7d3722004-07-18 06:25:50 +000023 for j in range(i, len(l), nrows):
Collin Winter65d09d42007-03-21 02:11:39 +000024 print(l[j].ljust(10), end=' ')
25 print()