#写入new文件 import json dic = {'name':'alex'} i = 8 s = 'hello' l = [11,22] f = open("new_hello","w") date = json.dumps(dic) f.write(date) #读取信息 f_read = open("new_hello","r") data = json.loads(f_read.read()) print(data)