import json

json.dumps:将 Python 对象编码成 JSON 字符串

json.loads:将已编码的 JSON 字符串解码为 Python 对象

json.dump:把json写入文件

# 把字典写入文件
with open('data.txt','w') as json_file:
  json.dump(game_merge,json_file, ensure_ascii = False)
  # json_file.write(json.dumps(game_merge, ensure_ascii = False))

 

相关文章:

  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-05-05
  • 2021-10-14
相关资源
相似解决方案