我有 JSON 数据,需要对其进行格式化并将空值设置为 null 发送到服务器。Python 中的字典不能将 null 作为值,但可以将“null”作为值。如何将上面的内容转换为Python可以识别的字典?
a = {"name":"p_retailprice","type":"DOUBLE","comment":"","precision":null,"scale":null}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'null' is not defined
Run Code Online (Sandbox Code Playgroud)