你的JSON文本似乎並沒有被很好地形成:
>>> import json
>>> json.loads('{"userCount":64,"users":[{"id":"553","acid":"553","ac":"240","cs":"Le AlphaDelta","st":{"gr":false},"co":[26.93526727771073,-79.9251579421954,10667.999977505215,-163.9999997562341,-2.2288855660652414,2.4376547336953407e-7],"ve":[-0.000002161617968514662,-6.915441330619387e-7,0.000004838653476326726,0,-2.27708260122718e-10,0],"ti":1487455628374.1194,"aircraft":"240","callsign":"Le AlphaDelta","time":1487455628374.1194}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 422 (char 421)
明白了:
>>> import json
>>> j = json.loads('{"userCount":64,"users":[{"id":"553","acid":"553","ac":"240","cs":"Le AlphaDelta","st":{"gr":false},"co":[26.93526727771073,-79.9251579421954,10667.999977505215,-163.9999997562341,-2.2288855660652414,2.4376547336953407e-7],"ve":[-0.000002161617968514662,-6.915441330619387e-7,0.000004838653476326726,0,-2.27708260122718e-10,0],"ti":1487455628374.1194,"aircraft":"240","callsign":"Le AlphaDelta","time":1487455628374.1194}]}')
>>> print j['users']
[{u'ac': u'240', u'co': [26.93526727771073, -79.9251579421954, 10667.999977505215, -163.9999997562341, -2.2288855660652414, 2.4376547336953407e-07], u've': [-2.161617968514662e-06, -6.915441330619387e-07, 4.838653476326726e-06, 0, -2.27708260122718e-10, 0], u'time': 1487455628374.1194, u'st': {u'gr': False}, u'aircraft': u'240', u'callsign': u'Le AlphaDelta', u'ti': 1487455628374.1194, u'cs': u'Le AlphaDelta', u'acid': u'553', u'id': u'553'}]
>>> print j['users'][0]['ac']
240
>>> print j['users'][0]['cs']
Le AlphaDelta
歡迎堆棧溢出。請參閱[問]並提供[mcve]。 –