首页 > Web开发 > 详细

读写json文件

时间:2019-11-15 15:52:58      阅读:92      评论:0      收藏:0      [点我收藏+]
def  read_json(path):
    """return dict"""
    with open(path,‘r+‘)as f:
          return json.load(f)
def write_json(path,data):
    with open(path,"w+")as f:
        json.dump(data,f,indent=2)

  .

读写json文件

原文:https://www.cnblogs.com/SunshineKimi/p/11866524.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!