Convert string to command..

Abandoned besturk at gmail.com
Thu Oct 18 11:53:41 EDT 2007


On Oct 18, 6:51 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> On Thu, 18 Oct 2007 08:41:30 -0700, Abandoned wrote:
> > 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 ??
>
> In Python terms yes, strings in Python can contain any byte value.  If you
> want to put this into a database you need a BLOB column or encode it as
> base64 or something similar more ASCII safe.
>
> Ciao,
>         Marc 'BlackJack' Rintsch

'{2:3,4:6,2:7}' already in database, i select this and convert to real
dictionary..




More information about the Python-list mailing list