with open("file.txt") as file_in:     lines = []     for line in file_in:         lines.append(line)

Read more of this post