I need cast a list to a string and get back the string to a list. There\'s a python way to make this behavior?
l1 = [\'aa\',\'bb\',\'cc\'] s = str(l1) l2 = c
The pickle module is probably what you're looking for:
import pickle l1 = ['aa','bb','cc'] s = pickle.dumps(l1) l2 = pickle.loads(s) print l2