HI people,
I've seen this technique used by someone at a past employer
but I can't remember exactly how to do it.
The idea is that I have a dictionary like:
params = { 'foo' : 1, 'bar' : 2, 'baz' : 3 }
and then I can do string replacement with something like:
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.
Thanks,
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders