What is the simplest way to convert a string of keyword=values to a dictionary, for example the following string:
name=\"John Smith\", age=34, height=173.2,
I would suggest a lazy way of doing this.
test_string = 'name="John Smith", age=34, height=173.2, location="US", avatar=":,=)"' eval("dict({})".format(test_string))
{'age': 34, 'location': 'US', 'avatar': ':,=)', 'name': 'John Smith', 'height': 173.2}
Hope this helps someone !