如何在 python 中将 JSON 写入具有空值的文件?

use*_*789 1 python

{“1”:空,“2”:假,“3”:真}

我不需要将它们转换为 None False True。

小智 6

根据此页面https://www.w3schools.com/python/python_json.asp

python None 类型转换为您正在寻找的 null

Python JSON
词典 目的
列表 大批
元组 大批
斯特 细绳
整数 数字
漂浮 数字
真的 真的
错误的 错误的
没有任何 无效的