Well, I didn't have any problems running a similar program. Here's the program I wrote: f = open("/tmp/example", "w") f.write("a\nb\nc\n") f.close() f = open("/tmp/example", "r") for line in f: print line.strip(), print f.seek(0) for lines in f: print line.strip(), And here's the output: a b c a b c