I am opening a .txt file and have to use a list inside of it for a function I am writing. This is one of the lists given in the text file:
.txt
\'[24, 72
Use ast.literal_eval:
ast.literal_eval
strs='[24, 72, 95, 100, 59, 80, 87]\n' list_of_strs = ast.literal_eval(strs)
Further help, leave a comment....