I have a python str object like this and i want to convert this into a list
l = "['Incorrect password.$', 'Login failed']" --- type <str>
expected output
l = ['Incorrect password.$', 'Login failed'] ---- type <list>
Trial 1:
p = list(l)
it makes l
as ['[', "'", 'I', 'n', 'c', 'o', 'r', 'r', 'e', 'c', 't', ' ', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '.', '$', "'", ',', ' ', "'", 'L', 'o', 'g', 'i', 'n', ' ', 'f', 'a', 'i', 'l', 'e', 'd', "'", ']']
Trial 2:
l.split(',')
second method is not favourable as the list element itself may contain comma in between.
How should i proceed? Any hint is appreciated.