[Tutor] HTML/text formatting question
jsmith at medplus.com
Wed Aug 3 17:29:41 CEST 2005
I have a tool that outputs data in either html or text output.
Currently I'm writing chucks like:
print '<html><body bgcolor="FFFFCC">'
print '<table border="1" bgcolor="CCCCFF" width="800">'
print '<tr><td colspan="2"><h2>'
print 'Differences %s: %s' % (htypestr, lbl1)
This seems clunky and my next step was going to be to define generic
functions which would generate the surrounding html tags only when
passed the proper argument. I was wondering if there was a better way
to do this with a standard Python library. It looked like formatter
might but that it also might be too low-level.
Any help is appreciated,
More information about the Tutor