import refilename = "index.html"newContent = "Hello Python World"filehandle = open(filename, "r")data = filehandle.read() filehandle.close()matching = re.subn("test", newContent, data)if matching[1] == 0: raise "Error while parsing HTML template"print "Content-Type: text/htmlnn"print matching[0]
Name (required)
email (will not be published) (required)
Website