jsonl_file.write(json.dumps(data) + '\n') 4. 追加寫入 JSONL 文件 如果需要追加數據到已有的JSONL文件中,可以使用追加模式 'a': 1 2 3 4 5 6 7 8 import json # 要追加寫入的 JSON 對象 new_data = {"name": "Diana", "age": 28, "city": "Houston"} # 追加寫入 JSONL 文件 with ...
www.dbjr.com.cn/python/326747f...htm 2025-5-29