Loading a Python collection from an text-file

Magnus Lycka lycka at carmen.se
Fri Jan 27 13:41:52 CET 2006


Ido Yehieli wrote:
> perhapse consider using the pickle module?
> http://docs.python.org/lib/module-pickle.html

User editable? We should be kind to our users!

 >>> d = {'peter':14, 'paul':23}
 >>> pickle.dumps(d)
"(dp0\nS'paul'\np1\nI23\nsS'peter'\np2\nI14\ns."



More information about the Python-list mailing list