Paul Rubin wrote: > The preferred way to remove the newline is more like: > for line in open('C:\\switches.txt'): > print line.rstrip() Interesting. So I would say: [line.rstrip() for line in open('C:\\switches.txt')]