Cool trick to convert strings into dictionary object in Python Programming
## Example
import ast
Method 1: Using ast.literal_eval
import ast
strr = "{'a': 1, 'b': 2, 'c': 3}"
strr_dict=ast.literal_eval(strr)
Method 2: Using json
## Example
Check here http://docs.python.org/library/json.html
Useful information thanks guys
ReplyDeleteWeb Designer in Bangalore