I retrieved the sting below form mysql table using python and I am having difficulty converting it into a list.
_string='[1,2,3,4]'
My attempt
>>> _string='[1,2,3,4]'
>>> sum(list(_string),[])
>>> list(_string)
['[', '1', ',', '2', ',', '3', ',', '4', ']']
>>> _string.strip('\n')
'[1,2,3,4]'
Desired output:
[1,2,3,4]
Is there and efficient way to get the desired output? as I will be doing a millions.