convert string representation of dict to dict python

49

convert string representation of dict to dict python -

>>> import ast
>>> ast.literal_eval("{'muffin' : 'lolz', 'foo' : 'kitty'}")
{'muffin': 'lolz', 'foo': 'kitty'}

Comments

Submit
0 Comments