Convert string to command..

Marc 'BlackJack' Rintsch bj_666 at
Thu Oct 18 17:51:24 CEST 2007

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.

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list