SyntaxFix
Write A Post
Hire A Developer
Questions
Assuming you also want to strip whitespace at beginning and end of each line, you can map the string strip function to the list returned by readlines:
map(str.strip, open('filename').readlines())