File: keywords.py

package info (click to toggle)
python2.4-doc 2.4.4-2
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 6,860 kB
  • ctags: 2,455
  • sloc: python: 5,194; perl: 3,666; sh: 1,605; makefile: 1,174; xml: 836; lisp: 836; ansic: 718; sed: 2
file content (19 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /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