I'd like to be able to take a formatted string and determine the
replacement dictionary necessary to do string interpolation with it.
For example:
str = 'his name was %(name)s and i saw him %(years)s ago.'
createdict( str ) {'name':'', 'years':''}
Notice how it would automatically fill in default values based on
type. I figure since python does this automatically maybe there is a
clever way to solve the problem. Otherwise I will just have to parse
the string myself. Any clever solutions to this?
Thanks
-dan