我正在运行此python 3脚本:data = json.load(urllib2.urlopen('http://data.mtgox.com/api/1/BTCUSD/ticker')[2])我在运行时收到此错误:Attribute error: addinfourl instance has no attribute'__getitem__' 19 while True: 20 lcd.clear() 21 url = 'http://data.mtgox.com/api/1/BTCUSD/ticker' 22 data = json.load(urllib2.urlopen(url))['return'] 23 lcd.message(datetime.now().strftime('%b %d %H:%M:%S\n')) 24 lcd.message( "MtGox: " + data["return"]["last"]["display"]) 25 sleep(10)
添加回答
举报
0/150
提交
取消