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
An answer has already been accepted, but I just wanted to add this for the record. The json module is really good for this kind of thing:
import json s = '[24, 72, 95, 100, 59, 80, 87]\n' lst = json.loads(s)