python将字典中的数据保存到文件中

d = {'a':'aaa','b':'bbb'}
s = str(d)
f = open('dict.txt','w')
f.writelines(s)
f.close()

原文地址:https://www.cnblogs.com/smuxiaolei/p/7374633.html