我要做的是找到关键“符号”下的市场价值。
使用此代码,我得到了错误
File "C:\Python27\bitcoinAPI", line 9, in getmarket
for key, value in data.items():
AttributeError: 'list' object has no attribute 'items'
这是代码:
def getmarket():
page = urllib2.urlopen("http://bitcoincharts.com/t/markets.json")
data = json.load(page)
for key, value in data.items():
if ["symbol"] == "mtgoxUSD":
print ["symbol"]
getmarket()
我也试过这个
for key, value in data.itervalues():
for key, value in data.iteritems():
他们都说列表没有属性 iterwhatever