I have a string, something like this: \"[[\'Cheese\', 72], [\'Milk\', 45], [\'Bread\', 22]]\".
\"[[\'Cheese\', 72], [\'Milk\', 45], [\'Bread\', 22]]\"
I want to convert this to a list. I know I can use eval(s
You might consider using the json module to deserialize and making sure your strings are in json format.
json
See http://docs.python.org/2/library/json.html for details about using this module.