且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 json.dumps() 的 MemoryError

更新时间:2023-09-11 21:23:34

你可以简单地替换

f.write(json.dumps(mytab,default=dthandler,indent=4))

json.dump(mytab, f, default=dthandler, indent=4)

这应该将数据流"到文件中.

This should "stream" the data into the file.