view Tools/scripts/suff.py @ 7464:021237ba5007 legacy-trunk

Make this work better with a4 paper. Make the table of contents "hot" for PDF output. No additional packages are needed. Move code for \b@code, \e@code into the macros for the verbatim environment directly since they're not used elsewhere. Derive the name of the modules .idx from the jobname. Some clean ups.
author Fred Drake <fdrake@acm.org>
date Wed, 25 Feb 1998 15:29:43 +0000
parents 73758db2f464
children 14a27acc755a
line wrap: on
line source

#! /usr/bin/env python

# suff
#
# show different suffixes amongst arguments

import sys

def main():
	files = sys.argv[1:]
	suffixes = {}
	for file in files:
		suff = getsuffix(file)
		if not suffixes.has_key(suff):
			suffixes[suff] = []
		suffixes[suff].append(file)
	keys = suffixes.keys()
	keys.sort()
	for suff in keys:
		print `suff`, len(suffixes[suff])

def getsuffix(file):
	suff = ''
	for i in range(len(file)):
		if file[i] == '.':
			suff = file[i:]
	return suff

main()