I am trying to use ArgumentParser.set_defaults from argparse. I want a keyworded tuple like this: parser.set_defaults(bar=42, baz='badger')
I have the item from the output of ConfigParser.items which is: ('baz','badger').
How do I convert this into the keyworded tuple that set_defaults is expecting?
If you have a list
[(key, value), (key, value), ...], you can turn it into a dict withthat_dict = dict(that_list). Then you can unpack it intoset_defaults, i.e.parser.set_default(**that_dict).