Hello,
I am a newbie and would like to know if it is possible to convert a
string back to a dictionary?
For example, I can convert a dictionary to a string by doing this:
[color=blue][color=green][color=darkred]
>>> names = {"Candy" : 2.95, "Popcorn" : 4.95}
>>> strNames = str(names)
>>> print strNames[/color][/color][/color]
{'Popcorn': 4.9500000000000 002, 'Candy': 2.9500000000000 002}
However, is there a way to convert a string back to a dictionary?
Any help is very much appreciated!
Byron
---
I am a newbie and would like to know if it is possible to convert a
string back to a dictionary?
For example, I can convert a dictionary to a string by doing this:
[color=blue][color=green][color=darkred]
>>> names = {"Candy" : 2.95, "Popcorn" : 4.95}
>>> strNames = str(names)
>>> print strNames[/color][/color][/color]
{'Popcorn': 4.9500000000000 002, 'Candy': 2.9500000000000 002}
However, is there a way to convert a string back to a dictionary?
Any help is very much appreciated!
Byron
---
Comment