source:
trunk/essentials/dev-lang/python/Doc/tools/keywords.py
| Last change on this file was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 392 bytes | |
| Line | |
|---|---|
| 1 | #! /usr/bin/env python |
| 2 | |
| 3 | # This Python program sorts and reformats the table of keywords in ref2.tex |
| 4 | |
| 5 | l = [] |
| 6 | try: |
| 7 | while 1: |
| 8 | l = l + raw_input().split() |
| 9 | except EOFError: |
| 10 | pass |
| 11 | l.sort() |
| 12 | for x in l[:]: |
| 13 | while l.count(x) > 1: l.remove(x) |
| 14 | ncols = 5 |
| 15 | nrows = (len(l)+ncols-1)/ncols |
| 16 | for i in range(nrows): |
| 17 | for j in range(i, len(l), nrows): |
| 18 | print l[j].ljust(10), |
| 19 |
Note:
See TracBrowser
for help on using the repository browser.
