import json dic={dict(name='bobe',age=16,score=88)} f=open('dummy.txt','wb') json.dump(dic,f) f.close() f=open('dummy.txt','rb') t=json.load(f) print(t)
json.dump(dic,f) 这一句报错
import json dic=dict(name='bobe',age=16,score=88) f=open('dummy.txt','wb') json.dump(dic,f) f.close() f=open('dummy.txt','rb') t=json.load(f) print(t)
上面代码贴错了
好吧,我发现了,没仔细看。。。尴尬
Sign in to make a reply
zL丶_44830
import json dic={dict(name='bobe',age=16,score=88)} f=open('dummy.txt','wb') json.dump(dic,f) f.close() f=open('dummy.txt','rb') t=json.load(f) print(t)
json.dump(dic,f) 这一句报错