I am trying to determine the best way to handle getting rid of newlines when reading in newline delimited files in Python.
What I\'ve come up with is the following c
I'd do it like this:
f = open('test.txt') l = [l for l in f.readlines() if l.strip()] f.close() print l