File: keywords.py

package info (click to toggle)
python-old-doctools 2.5.5-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 984 kB
  • ctags: 973
  • sloc: python: 4,666; perl: 3,674; lisp: 854; xml: 836; sh: 251; makefile: 85; ansic: 46; 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