python使用json读写

写:

with open(os.path.join(out_dir,'val.json'),"w") as v:

        json.dump(val_dict, v)

读:

Train_file = '/root/zhn/video_highlights/dataset/regression/train.json'

Train_file = open(Train_file,'r')

Train=json.load(Train_file)

你可能感兴趣的:(python使用json读写)