iterating on a file using python,f.seek(0)