多条dict写入json文件的时候,怎么加换行符

2025-03-19 14:57:34
推荐回答(1个)
回答(1):

for line in file:
data.append('\n'+json.loads(line))
这样先换行再读取下一行试试。