python-本地读取和保存字典文件
dic = {'a': 1, 'b': 2, 'c': 3, 'd': 1}# save to local
f = open("..\\data\\dict.txt", 'w')
f.write(str(dic))
f.close()
print("save dict successfully.")
# read from local
f = open("..\\data\\dict.txt", 'r')
dict_ = eval(f.read())
f.close()
print("read from local : ", dict_)
————————————————
https://blog.csdn.net/xidianbaby/java/article/details/86537871
页:
[1]