You need to use a JSON library for Python. Here is a good one that i
have found, and using for quite sometime.
http://code.google.com/p/google-app-engine-samples/source/browse/trunk/geochat/json.py
Also, refer to the Application's source code to understand how to use
this
http://code.google.com/
I am getting a very simple json string that contains only 14 elements
Can't we use python dictionary to extract the elements of json?
Thanks
Arnie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Google App Engine" gr
json = '{element1: "haha", element2: 123}'
d = eval(json)
print d['element1'], d.['element2']
2009/5/6 arnie
>
> I am getting a very simple json string that contains only 14 elements
> Can't we use python dictionary to extract the elements of json?
> Thanks
> Arnie
> >
>
--~--~-~--~---
eval() the strings you receive in the request?
One way of getting to execute any python code in his application.
You can use the simple JSON that comes with GAE in Django
from django.utils import simplejson
2009/5/6 风笑雪 :
> json = '{element1: "haha", element2: 123}'
> d = eval(json)
> print d[
Arnie,
I'm assuming you want to iterate over the json in Python?
Once you get the json string converted to a Python dictionary using
simplejson, you can use the dictionary's iteritems() method to iterate
over it in a python forloop like so:
from django.utils import simplejson
#jsonStr is your
I would also do it in this manner.
On May 6, 9:35 am, ray wrote:
> Arnie,
> I'm assuming you want to iterate over the json in Python?
>
> Once you get the json string converted to a Python dictionary using
> simplejson, you can use the dictionary's iteritems() method to iterate
> over it in a py