首页 > Web开发 > 详细

模块(jsonpath、加密)

时间:2021-01-24 18:26:39      阅读:40      评论:0      收藏:0      [点我收藏+]

1.jsonpath模块

import jsonpath

wsc = {
    "money":19000,
    "house":{
        "beijing":["三环","四环","五环"],
        "shanghai":["静安区","浦东新区"]
    },
    "car":["bmw",benz,audi,byd],
    "pets":[
        {"name":"xiaohei","type":"dog"},
        {"name":"xiaobai","type":"cat"},
        {"name":"xiaofen","type":"cat"},
        {"name":"xiaolan","type":"dog"},
    ]
}

#$.pets[0].type
#result  = wsc["pets"][0]["type"] #原有的方法获取
#result  = jsonpath.jsonpath(wsc,"$.pets[0].type")
#result  = jsonpath.jsonpath(wsc,"$..car")
result  = jsonpath.jsonpath(wsc,"$..beijing")
print(result)

 

模块(jsonpath、加密)

原文:https://www.cnblogs.com/huahuacheng/p/14320980.html

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