python使用json读写

2018-07-01  本文已影响0人  zhnidj

写:

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)

上一篇 下一篇

猜你喜欢

热点阅读