Hi Peter, On Fri, Nov 20, 2015 at 04:53:47PM +0100, Peter Otten wrote: > Ervin Hegedüs wrote: > > > Python has a good string formatter, eg. I can do this: > > > > s = "{who} likes {what}" > > d = {'who': "Adam", 'what': "ants"} > > s.format(**d) > > > > result: > > 'Adam likes ants' > > > > Is it possible, and if yes, how to resolve the placeholders names > > in string? > > >>> import string > >>> for item in string.Formatter().parse("{who} likes {what}"): > ... print(item) > ... > ('', 'who', '', None) > (' likes ', 'what', '', None)
nice solution, thanks, a. -- I � UTF-8 -- https://mail.python.org/mailman/listinfo/python-list