print(text)
---------------------------------------------------------------------------
UnicodeDecodeError..."三国演义片头曲_utf.txt", "r", encoding="gbk") as f:
----> 2 text = f.read()
3 print(text)
UnicodeDecodeError...{"math":92 , "physics": 99},
"Mary":{"math":98 , "physics": 97}}
with open("score.json", "w",...encoding="utf-8") as f: # 写入整个对象
# indent 表示字符串换行+缩进 ensure_ascii=False 显示中文...json.dump(scores, f, indent=4, ensure_ascii=False)
读取——load()
with open("score.json", "r", encoding