#- f = open('somefile', 'r') #- for lines in f: #- some operations #- f.seek(0) I think will be very useful if you detail what those "some operations" are. . Facundo