#!/usr/bin/env python for n in xrange(171, 531): f = open('letters/letter' + str(n) + '.txt') bytes = f.read() f.close() f = open('letter' + str(n) + '.html', 'w') print >> f, '' print >> f, "Coleridge's Letters, No." + str(n) + "" print >> f, """\ """ bytes = bytes.replace('&', '&').replace('<', '<') print >> f, '

' + bytes + '

' f.close() # EOF