@
knightdf 我这里还是悲剧的,请问你用的是哪个版本的 python ?
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('/var/www/html/bookmark_data.json', 'r')
>>> s = f.read()
>>> f.close()
>>> import json
>>> json.loads(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/json/
__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/
decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/
decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
>>> print s[:100]
{"data":[{"id":"0","dateAdded":1471567289926},{"id":"1","title":"Bookmarks%20bar","parentId":"0",