make reading files more memory efficient

Awesome: you are using list comprehension
Not a huge deal but generator comprehension is even better
I don't think you need to call .readlines() either
Also avoid overwriting the same variable just because of keeping things clean/readable
=> now it's just generators so no worries about memory issues :)