I use the following code segment to read a file in python:
with open (\"data.txt\", \"r\") as myfile: data=myfile.readlines()
Input fil
python3: Google "list comphrension" if the square bracket syntax is new to you.
with open('data.txt') as f: lines = [ line.strip( ) for line in list(f) ]