Oops, silly me, it was posted, but I think there was a typo in it: > for line in open('c:/temp/temp.txt'): is missing the ".readlines()" part.