SyntaxFix
Write A Post
Hire A Developer
Questions
This is more explicit than necessary, but does what you want.
with open("file.txt") as file_in: lines = [] for line in file_in: lines.append(line)