How to serialize a big dict to a disk file, such that small modifications don't require a full rewrite, but only a few bytes?

后端 未结 0 485
天命终不由人
天命终不由人 2020-11-21 23:46

Let\'s work with a big dictionary (110 MB) and save it to disk:

import pickle, os
d = {i: os.urandom(100) for i in range(1_000_000)}  
with open(\'mydict\', \         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题