Minimum Working Example:
response = [{ "UserStor": "id1","StoryTitle": "title1","StoryState": "state1", "UserStoryType": "type1","RawUpdates": "updates1","RawComments": "comments1"}]
If I need to access this dictionary, I can do:
print(response[0])
#output
{'UserStor': 'id1', 'StoryTitle': 'title1', 'StoryState': 'state1', 'UserStoryType': 'type1', 'RawUpdates': 'updates1', 'RawComments': 'comments1'}
---
Now, I have another dictionary but, it is inside a string
response = "{'UserStor': 'id1', 'StoryTitle': 'title1', 'StoryState': 'state1', 'UserStoryType': 'type1', 'RawUpdates': 'updates1', 'RawComments': 'comments1'}"
How, can I access this dictionary?
I know I can use ast.literal_eval().
Is there any other way to access this dictionary without using literal_eval()/eval() ?
I am here to learn, your comments and answers are welcome.