开发者社区> 问答> 正文

python怎么遍历json数组

python怎么遍历json数组

展开
收起
云计算小粉 2018-05-10 20:11:05 11720 0
2 条回答
写回答
取消 提交回答
  • x_dict = {"name":111, "age":[1,2,3]}

    for key, value in x_dict.items(): xxxxx

    for i in x_dict['age']: print(i)

    两种方法都可。

    2019-11-05 16:15:38
    赞同 展开评论 打赏
  • {
    "apps_count": 6,
    "page_size": 20,
    "items": [

    {
      "id": "59bf8e26959d69523e000177",
      "user_id": "XXXXXX",
      "org_id": "59bba986548b7a1688812a7c",
      "type": "android",
      "name": "yljk",
      "short": "yx9a",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": 1505725990,
      "updated_at": 1505726002,
      "expired_at": 1505898802,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    },
    {
      "id": "XXXXXX",
      "user_id": "XXXXXX",
      "org_id": "XXXXXX",
      "type": "android",
      "name": "wld",
      "short": "bpdb",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": XXXXXX,
      "updated_at": XXXXXX,
      "expired_at": XXXXXX,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    },
    {
      "id": "XXXXXX",
      "user_id": "XXXXXX",
      "org_id": "XXXXXX",
      "type": "android",
      "name": "wzlj",
      "short": "1tdc",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": XXXXXX,
      "updated_at": XXXXXX,
      "expired_at": XXXXXX,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    },
    {
      "id": "XXXXXX",
      "user_id": "XXXXXX",
      "org_id": "XXXXXX",
      "type": "android",
      "name": "maib",
      "short": "y6td",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": XXXXXX,
      "updated_at": XXXXXX,
      "expired_at": XXXXXX,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    },
    {
      "id": "XXXXXX",
      "user_id": "XXXXXX",
      "org_id": "XXXXXX",
      "type": "android",
      "name": "jieb",
      "short": "jg3e",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": XXXXXX,
      "updated_at": XXXXXX,
      "expired_at": XXXXXX,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    },
    {
      "id": "XXXXXX",
      "user_id": "XXXXXX",
      "org_id": "XXXXXX",
      "type": "android",
      "name": "xxdk",
      "short": "5ewf",
      "bundle_id": "XXXXXX",
      "genre_id": 0,
      "is_opened": false,
      "web_template": "default",
      "custom_market_url": "",
      "has_combo": false,
      "created_at": XXXXXX,
      "updated_at": XXXXXX,
      "expired_at": XXXXXX,
      "icon_url": "https://XXXXXX.com",
      "master_release": {
        "version": "1.0.0",
        "build": "1",
        "release_type": "inhouse",
        "distribution_name": "",
        "supported_platform": null,
        "created_at": XXXXXX
      }
    }

    ]
    }

    2019-07-17 22:25:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载