import json a = [1,2,3] b = 1 c = {"aduan":"codemao"} # 以json的形式写入文件 with open('data.json','w') as f: json.dump(a,f) #从json文件读取数据 with open('data.json','r') as f: content = json.load(f) print(content) # 打印内容 print(type(content)) # 打印数据类型