简体   繁体   中英

loading json file using python

I am trying to load json file availalble here : https://gist.githubusercontent.com/anonymous/e5ef9cb96acb98e1f813d5166d472c70/raw/eabf219c51ace122ad82b7037bbf93d347fb4a9b/data.json

with open('data.json') as data_file:
    data = json.load(data_file)

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/karimk/python/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/home/karimk/python/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/home/karimk/python/lib/python2.7/json/decoder.py", line 367, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 3 column 1 - line 6 column 740 (char 2826 - 16384)

What wrong am I doing here?

出了什么问题:json无效解决方案:将数据更新为有效的json,例如,删除字符串项目中的行尾。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM