With Python, can I keep a persistent dictionary and modify it?

后端 未结 7 1328
孤城傲影
孤城傲影 2020-12-16 16:23

So, I want to store a dictionary in a persistent file. Is there a way to use regular dictionary methods to add, print, or delete entries from the dictionary in that file?

7条回答
  •  青春惊慌失措
    2020-12-16 16:52

    If using only strings as keys (as allowed by the shelve module) is not enough, the FileDict might be a good way to solve this problem.

提交回复
热议问题