Serializing Python Object To / From S60 Phone

I am looking for a way to serialize shared Python objects between a CherryPy based server and a Python client running on a Symbian phone. Since pyS60 does not implement the pickle module, how would you do this?

I know about Cerealizer , but it requires you to register the classes before using (which I would like to avoid) I look very mature .. So, which would you use? Perhaps Python 2.2, perhaps pulled from sources? XML, JSON? Which of several libraries? :)

+1


source to share


3 answers


What happened to using the brine module?



+2


source


There is a json module that someone wrote for PyS60. I just grab this, serialize things to json, and use that as a transfer method between the web client application.



For the json lib and a decent book on PyS60: http://www.mobilepythonbook.org/

+1


source


Recent versions of Python (> 1.9) have module mocking and cPickle available

Another alternative to JSON serialization is to use netstring (look on wikipedia) format for serialization. It is actually more efficient than JSON for binary objects.

You can find a good netstring module here http://github.com/tuulos/aino/blob/d78c92985ff1d701ddf99c3445b97f452d4f7fe2/wp/node/netstring.py (or aino / wp / node / netstring.py)

+1


source







All Articles