import json
dic = '{"name":"alex"}' #--->{"name":"alex"}--->'{"name":"alex"}'
i = 8 #--->'8'
s = 'hello' #--->"hello"--->'"hello"'
l = [11,22] #--->"[11,22]"
print(eval(dic)) --->{"name":"alex"}
dic = json.loads(dic)
print(dic["name"]) --->alex

data = json.dumps(dic) #json字符串:所有引号变成双引号
print(data,type(data)) --->{"name": "alex"} <class 'str'>

f = open("hello","w")
f.write(data) / json.dump(dic,f)
f.close()
f = open("hello","r")
data = json.loads(f.read()) / data = json.load(f)
f.close()
print(data["name"],type(data)) --->alex <class 'dict'>