temp = "['a','b','c']"
print type(temp)
#string
output = ['a','b','c']
print type(output)
#list
so i have this temporary string which is basically a list in string format . . . i'm trying to turn it back into a list but i'm not sure a simple way to do it . i know one way but i'd rather not use regex
if i use temp.split() I get
temp_2 = ["['a','b','c']"]
json.dumps, usejson.loads, and so on. If you got it byrepr, not everything can be reversed, and not everything that can be should be… butast.literal_evalis the answer for things that can/should.