From: Ype K. <yk...@xs...> - 2002-03-21 19:27:01
|
Brad, >Does python have a way of interpolating variables into strings, along the lines of this perl example? > >my $title = "My title"; >my $body = "Blah, blah"; >print """ ><html> > <head> > <title>$title</title> > </head> > <body>$body</body> ></html>""" my = {} my['title'] = "My title" my['body'] = "Blah, blah" print """ <html> <head> <title>%(title)s</title> </head> <body>%(body)s</body> </html>""" % my See http://www.python.org/doc/current/lib/typesseq-strings.html Regards, Ype -- |