python json demo
值得注意的一点是,list类型的数据可以用[2,3]的方式定义,如"b"
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。import json jsonData = '{"a":1,"b":[2.0,2.1,2.2],"c":3,"d":4,"e":5}' text = json.loads(jsonData) print(type(text)) print(text) print(type(text['b'])) print(text['b']) y = json.dumps(text, sort_keys=True, indent=4, separators=(',', ': ')) print('y =') print(y)

更多精彩