Python: AttributeError: ‘_io.TextIOWrapper’ object has no attribute ‘split’
You are using str methods on an open file object. You can read the file as a list of lines by simply calling list() on the file object: This does include the newline characters. You can strip those in a list comprehension: