Can I convert a string to arguments list in python?
def func(**args): for a in args: print a, args[a] func(a=2, b=3) # I want the following work li
You could massage the input string into a dictionary and then call your function with that, e.g.
>>> x='a=2, b=3' >>> args = dict(e.split('=') for e in x.split(', ')) >>> f(**args) a 2 b 3