generate HTML

s99999999s2003 at yahoo.com s99999999s2003 at yahoo.com
Mon Nov 14 04:56:40 EST 2005


hi
i have fucntion that generates a HTML page

def genpage(arg1,arg2):
   print ''' <div align="right"><font size="-1">BLAH BLAH.....%s %s
          ''' % (arg1, arg2)

   print ''' <table> ....blah blah... %s %s

          </table>''' % (arg1,arg2)'

The func is something like that, alot of open''' and closing ''' triple
quotes. anyway, i wish to print all these into a HTML output file so
that when i click on it, it shows me the html page. How can i do that?

i tried
f = open("output.html","w")
f.write ( 'print '''<div align ....

I am stuck at above after doing a lot of f.write for every line of HTML
. Any betterways to do this in python?

something like here documents in a shell script where it can also be
directed to a file.
thanks




More information about the Python-list mailing list