errors with json.loads
Ned Batchelder
ned at nedbatchelder.com
Thu Sep 21 12:36:33 EDT 2017
On 9/21/17 12:18 PM, john polo wrote:
> Bill,
> Thanks for the reply. I wasn't sure how to get Python 2 through the
> cmd or IPython, so I went through ArcGIS, but it's mostly the same
> result:
>
> >>> file = open('books.json','r')
> >>> text = file.read()
> >>> text = json.loads(text)
After the file.read() line, put this: print(repr(text)) or
print(ascii(text)) if you are on Python 3. Show us that output. That
will make clear what is wrong with the data.
--Ned.
More information about the Python-list
mailing list