1

これについても同様の質問がたくさんありますが、最も単純なケースを機能させることができるようです。

コードは次のとおりです。

retval = urllib2.Request(callstr)
opener = urllib2.build_opener()
f = opener.open(retval)
json = simplejson.load(f)
for item in json:
    print item.get("ExtActionResponse.info")

jsonオブジェクトは正しく入力されているようです。

 json
     ExtActionRepsonse  <dict ox7122345...>
        info            u"345167273\n1234:56768"    <----- This is the data I'm expecting
        resultCode      u"0"
        resultStr       u"Success"
        ...etc...

しかし、それはgetitem呼び出しで窒息します。

  print item.get("ExtActionResponse.info")

ありがとう

4

1 に答える 1

3

..... 何?

print json['ExtActionResponse']['info']
于 2013-01-18T17:21:55.807 に答える