Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread Nadir Sampaoli
Hello everyone (my first message in the mailing list), > > Is the following function correct? > Yes, though I'd use json.load(f) instead of json.loads(). > The docs aren't very clear (at least for me) about the difference between json.load()

Re: Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread Nadir Sampaoli
2012/3/28 ian douglas > > The functions with an s take string parameters. The others take file > streams. > > foo = '{"age": 38}' > my_json = json.loads(foo) > I see, it makes perfectly sense now. Thanks for clearing it up. -- http://mail.python.org/mailman/listinfo/python-list