Verify JSON Data
Chris Angelico
rosuav at gmail.com
Mon May 26 12:00:30 EDT 2014
On Tue, May 27, 2014 at 1:19 AM, Roy Smith <roy at panix.com> wrote:
> Python comes with a built-in json module. Just use json.load() or
> json.loads() to parse your JSON data. The first call reads from a
> string, the second on from a file, but in all other ways, they're
> identical.
Minor nit-pick: they're the other way around - load() reads from a
file and loads() reads from a string. I wouldn't bother commenting,
except that load() could plausibly mean "load from string", and "'str'
object has no attribute 'read'" might be a bit of a surprise else :)
ChrisA
More information about the Python-list
mailing list