How to convert all arguments to dictionary in python [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I would like to my function func(*args, **kwargs) return one dictionary which contains all arguments I gave to it. For example: func(arg1, arg2, arg3=value3, arg4=value4) should return one dictionary like this: {'arg1': value1, 'arg2': value2, 'arg3': value3, 'arg4': value4 } 回答1: You can use