Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: b2b1ed17819ecb24a78d07d3ff1e8e6bc6137721 authored by cvs2svn on 26 August 1996, 18:33:32 UTC
This commit was manufactured by cvs2svn to create tag 'r14beta3'.
Tip revision: b2b1ed1
keywords.py
#! /usr/local/bin/python

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

import string
l = []
try:
	while 1:
		l = l + string.split(raw_input())
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 string.ljust(l[j], 10),
	print
back to top