On Wed, 2006-08-16 at 10:15 +1000, Erik de Castro Lopo wrote:
>     str = "Foo : %{foo}  Bar : %{bar}   Baz : %{baz}" % params
> 
> which should result in str being "Foo : 1  Bar : 2   Baz : 3".
> 
> Problem is, "%{foo}" doesn't work, I can't remember the right
> incantation, Google isn't being helful and I can't find anything
> in the Python docs.
> 
> Can somone please give me a whack with the cluebat.

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

Now. Why is python so easy going that it lets me always specify strings
there, when the elements of params are clearly integers?

-- 
Pete

_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to