From: Brad C. <bc...@vi...> - 2002-03-21 20:01:13
|
Thanks! I was afraid I'd have to import my java multi-line string preprocessor from java to do this in python. See http://virtualschool.edu/jwaa under Mls. At 8:39 PM +0100 3/21/02, Ype Kingma wrote: >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 > > >-- > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users -- Brad Cox, PhD; bc...@vi... 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa |