read file 'filename' line by line into a list `lines`,lines = [line.rstrip('\n') for line in open('filename')]