I have new to python programming.
I have sucessfully converted a dictionary into a string.
but i want to know how can convert the string back to the dictionary.
let us say that 'd' is dictionary
>>>from cStringIO import StringIO
>>> d={'a':'google' , 'b':80, 'c':'string'}
>>> sio = StringIO()
>>> for item in d.iteritems():
... sio.write('%s, %s / ' %item)
>>> sio.getvalue()
a, google / c, string / b, 80
i have stored this value into a variable.
i want convert back this string into dictionary. how can i do this..
Plz help me out with this........... .
thxs in advance........
I have sucessfully converted a dictionary into a string.
but i want to know how can convert the string back to the dictionary.
let us say that 'd' is dictionary
>>>from cStringIO import StringIO
>>> d={'a':'google' , 'b':80, 'c':'string'}
>>> sio = StringIO()
>>> for item in d.iteritems():
... sio.write('%s, %s / ' %item)
>>> sio.getvalue()
a, google / c, string / b, 80
i have stored this value into a variable.
i want convert back this string into dictionary. how can i do this..
Plz help me out with this........... .
thxs in advance........
Comment