[Sugar-devel] How to serialize objects?
wadetb at gmail.com
Tue Mar 17 16:21:43 EDT 2009
Many Sugar activities use simplejson to serialize activity state in
the JSON format.
You can see an example below. It's done in a way that's backwards
compatible between Python 2.5 & 2.6, since there was a 'json' module
in OLPC distributions of Python 2.5 that was *not* simplejson, whereas
in Python 2.6 simplejson is known as 'json'.
On Tue, Mar 17, 2009 at 3:21 PM, Behavior Vehikel
<b.vehikel at googlemail.com> wrote:
> at the moment I am learning to implement a Sugar activity. In the
> Sucrose 0.84 release notes
> there is a short paragraph about serializing and de-serializing a
> Python object structure.
> Should I use cjson for saving the state of my activity?
> Where can I find sample code?
> In a former project (outside of Sugar) I used pickle for object
> serializing and de-serializing. Is better for compatibility to use
> cjson instead of pickle? One advantage of json is its human readable
> output. But why is object serializing not done in XML?
> best regards
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
More information about the Sugar-devel