Newbie Nugget: Introduction to the with statement
Understanding Python’s “with” statement
from __future__ import with_statement with open('../documents/new-data-morrisons-competition.txt', 'rb') as f: for line in f: data = line.split('\t')