【问题标题】:MIT APP INVENTOR 2 dictionary troubleMIT APP INVENTOR 2 字典麻烦
【发布时间】:2018-04-26 13:16:25
【问题描述】:

MIT APP INVENTOR 2 我有这个问题:我有一本包含许多子类的字典。但我不知道如何访问字典中的特定数据。例如一个有下一个列表:

{
  "keystatus" : "valid",
  "status" : 0,
  "result" : [
    {
      "stores" : {
        "0" : {
          "category" : "",
          "min_price" : "64.90",
          "manufacturer" : "adidas",
          "url" : "https:\/\/www.rakuten.de\/%20produkt%20\/adidas-leonero-herrenschuhe-sneaker-2040331525.html?portaldv=6",
          "title" : "adidas Leonero Herrenschuhe Sneaker",
          "advertiser" : "Rakuten Deutschland GmbH",
          "currency" : "€",
          "max_price" : ""
        }
      },
      "details" : {
        "barcode_formats" : "EAN 4058025901204",
        "color" : "",
        "publisher" : "",
        "weight" : "",
        "actor" : "",
        "brand" : "adidas",
        "product_name" : "adidas Leonero Herrenschuhe Sneaker",
        "category" : "",
        "prod_details" : "",
        "manufacturer" : "adidas",
        "length" : "",
        "label" : "",
        "clothing_size" : "",
        "artist" : "",
        "height" : "",
        "model" : "",
        "width" : "",
        "director" : "",
        "genre" : "",
        "manufacturer_part_number" : "Adidas Leonero",
        "long_description" : "Nach 70 Jahren als einer der weltbesten Hersteller von FuBballschuhen hat adidas jede Menge Erfahrung gesammelt, wenn es um cleanen Sportstyle geht. Wir haben uns von einigen der legendärsten Designs aus unseren Archiven inspirieren lassen und m",
        "features" : "",
        "author" : ""
      },
      "reviews" : {

      },
      "type" : "EAN",
      "images" : {
        "0" : "https:\/\/images.barcodelookup.com\/9152\/91526482-1.jpg"
      },
      "barcode" : "4058025901204"
    }
  ]
}

我想访问字典 ["result"][0]["stores"]["0"]["title"] 的这一部分。有什么想法吗?

欢迎所有想法。谢谢

【问题讨论】:

  • 写一些代码。如果代码不起作用,我们都可以盯着它并帮助您。 How to Ask

标签: app-inventor


【解决方案1】:

您将必须学习如何使用列表和列表列表...

查看这些示例:
How to work with Lists by Saj
How to work with Lists and Lists of lists (pdf) by appinventor.org
JSON 和列表列表:example1example2

【讨论】:

    猜你喜欢
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-11
    • 2021-05-30
    相关资源
    最近更新 更多