summaryrefslogtreecommitdiffstats
path: root/Doc/tools/keywords.py
blob: f9e4b032b1eac06c6aba21d8400cc88fa6bf5024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/env python

# This Python program sorts and reformats the table of keywords in ref2.tex

def raw_input(prompt):
    import sys
    sys.stdout.write(prompt)
    sys.stdout.flush()
    return sys.stdin.readline()

l = []
try:
    while 1:
        l = l + raw_input().split()
except EOFError:
    pass
l.sort()
for x in l[:]:
    while l.count(x) > 1: l.remove(x)
ncols = 5
nrows = (len(l)+ncols-1)/ncols
for i in range(nrows):
    for j in range(i, len(l), nrows):
        print(l[j].ljust(10), end=' ')
    print()