import json d = dict(name='Bob', age=20, score=88) f=open('E:\lianxi\python\json.txt','w') #需要注意的是这里需要使用w而不是wb print(json.dump(d,f)) f.close() f=open('E:\lianxi\python\json.txt','r') d=json.load(f) f.close() print(d)
Sign in to make a reply
雨鸢梦