Python搜索文件并存储为变量

Python搜索文件并存储为变量,python,http,full-text-search,Python,Http,Full Text Search,我希望让我的程序使用HTTP get来读取有关我的智能设备的信息 我想搜索“name”,然后将“corner light”放入数组中 { "1": { "state": { "on": true, "bri": 114, "alert": "none", "reachable": true }, "type": "Dimmable light", "name": "corner light",

我希望让我的程序使用HTTP get来读取有关我的智能设备的信息

我想搜索“name”,然后将“corner light”放入数组中

{
"1": {
    "state": {
        "on": true,
        "bri": 114,
        "alert": "none",
        "reachable": true
    },
    "type": "Dimmable light",
    "name": "corner light",
    "modelid": "LWB010",
    "manufacturername": "Philips",
},

你为什么要“搜索”?JSON是一种定义良好的格式,您计划获得的HTTP端点的输出大概也是如此。只需
导入json;json.loads()
it-或使用Python请求,该请求以本机方式处理json。请添加相关的json,例如抱歉,已添加。