This one time, at band camp, Erik de Castro Lopo wrote: >Peter Hardy wrote: > >> They're round braces in the string, not curly ones. And you need the >> format in there as well. >> >> str = "Foo : %(foo)s Bar : %(bar)s Baz : %(baz)s" % params > >Brilliant. Thanks Peter. > >> Now. Why is python so easy going that it lets me always specify strings >> there, when the elements of params are clearly integers? > ><underwear type="asbestos"> >Thats the stupidity of dynamic typing. ></underwear>
"%(action)s %(person)s with %(weapon)s" % dict(action='spray', person='erik', weapon='flamethrower') _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders