📜  python json dump utf8 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:32.450000             🧑  作者: Mango

代码示例1
data = { 
  "name": "foo",
  "age": 27
}
with open("test.json", 'w', encoding='utf8') as outfile:
    json.dump(data, outfile, indent=2)