Thomas
Try:
>>> import simplejson
>>> simplejson.loads('{"totalspace":243862.672,"freespace":94053.564}')
{'freespace': 94053.563999999998, 'totalspace': 243862.67199999999}
>>>
Although cjson is a lot faster, you should have simplejson if you are
using Django.
Thanos
On May 3, 12:33 pm, Thomas Allen <[email protected]> wrote:
> How can I parse a simple JSON object in Django?
>
> I would like to parse the response: {"totalspace":
> 243862.672,"freespace":94053.564}
>
> django.core.serializers.deserialize('json', packet) seems to have
> trouble parsing such a simple string.
>
> Thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.