Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: abbb5e1f0130306494821b7ebb04f6d4af761b2c authored by Martin v. Löwis on 31 March 2006, 15:20:56 UTC
Remove tag, to recreate it right away.
Tip revision: abbb5e1
keywords.py
#! /usr/bin/env python

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

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),
    print
back to top