json使用
作者:互联网
# 加载数据成字典(读)
with open(annotations_file, "r") as fa:
annotations = json.load(fa)
# 上载数据成序列(写)
with open("annotation/train_annotation.json", 'w') as fp:
json.dump(annotations, fp, indent=4, separators=(',', ': '))
标签:fp,annotation,fa,json,使用,open,annotations 来源: https://www.cnblogs.com/Guang-Jun/p/14821269.html