#!/usr/bin/python import sys, textwrap def do_wrap(filename): f = open(filename, 'r') for line in f: text = "\n".join(textwrap.wrap(line, 80)) text = text.replace('a', '4') text = text.replace('e', '3') text = text.replace('i', '1') text = text.replace('o', '0') text = text.replace('s', '5') text = text.replace('b', '8') text = text.replace('t', '7') print text def main(args): if (len(args) < 2): print "usage:", args[0], "filename" sys.exit(1) else: do_wrap(args[1]) if __name__ == '__main__': main(sys.argv)