#!/usr/bin/env python import re import avocet2 with open('whits.txt') as f: text = unicode(f.read(), 'utf-8') print 'Content-Type: text/html; charset=utf-8' print print '' print '
(\d+ \w+ \d+, \d+:\d+)') text = avocet2.hypertext(text).encode('utf-8') text = r_date.sub(r'
\g<1>', text) print text