在Python 3中,加载之前保存的json如下:
json.dumps(dictionary)
输出是这样的
{"('Hello',)": 6, "('Hi',)": 5}
我用的时候
json.loads({"('Hello',)": 6, "('Hi',)": 5})
它不起作用,发生这种情况:
TypeError:JSON对象必须是str,bytes或bytearray,而不是'dict'
python json dictionary
dictionary ×1
json ×1
python ×1