Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 6c52d76db8b1cb836c136bd6a1044e85bfe8241e authored by Georg Brandl on 05 March 2011, 13:55:46 UTC
Close 2.3 branch.
Tip revision: 6c52d76
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