Convert string to command..

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Oct 18 13:30:54 EDT 2007


Abandoned a écrit :
(snip)
> import cPickle as pickle
> a="{2:3,4:6,2:7}"
> s=pickle.dumps(a, -1)
> g=pickle.loads(s);
> print g
> '{2:3,4:6,2:7}'
> 
> Thank you very much for your answer but result is a string ??
> 
Of course it's a string. That's what you pickled. What did you hope ? If 
you want a dict back, then pickle a dict.



More information about the Python-list mailing list