#coding=utf-8                                                                                                                                                                             
    import json
    data ={"update_time":"12982929921","version":"0.0.0","desc":{"hdw":{"desc":{"power":"1.0.0","motor":"1.0.0","imu":"1.0.0","sensor":"1.0.1"},"version":"0.0.2"},"soft":{"desc":{"web":"            1.0.0","server":"1.0.0","base":"1.0.0"},"version":"0.0.1"}}}
    
    #写入
    with open('tmp.json', 'w') as f:
        json.dump(data, f)
    try:
        with open('tmp.json', 'r') as f:
            k=json.load(f)
            print(k)
    except ValueError:
        print("empty!")

 

相关文章:

  • 2022-12-23
  • 2021-10-20
  • 2021-06-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-09-08
  • 2023-04-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案