سؤال

I have a list of dicts:

          for item in list:
          listDicts.append(item.AsDict())

How convert listDicts to json string, using simplejson ? Making the list each dictionary will be an object in JSON.

هل كانت مفيدة؟

المحلول

Have you tried json.dumps(listDicts)? It comes out of the box. I'm not sure what simplejson would buy you; in fact, I think they're the same thing.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top