Get dictionary-keys used to format a string

Michael Ströder michael.stroeder at inka.de
Thu Mar 2 05:27:05 EST 2000


Hence the example from the Python docs:

'%(language)s has %(count)03d quote types.' % vars()

I would like to extract the keys in the formatting string to a list.
Well I can parse it myself but is there a built-in function to
extract a list/tuple of the dictionary keys, e.g.
['language','count'] in this case?

Thanks.

Ciao, Michael.



More information about the Python-list mailing list