astモジュールを使う
import ast
str = "{'Name':'yuta','Country':'Japan'}"
dict = ast.literal_eval(str)
print(dict['Name'])
print(dict['Country'])
yuta / tmp python dict.py
yuta
Japan
Go to list of users who liked
More than 1 year has passed since last update.
astモジュールを使う
import ast
str = "{'Name':'yuta','Country':'Japan'}"
dict = ast.literal_eval(str)
print(dict['Name'])
print(dict['Country'])
yuta / tmp python dict.py
yuta
Japan
Register as a new user and use Qiita more conveniently
Go to list of users who liked