The following simple Python script attempts to show how to iterate over each line of a (text) file:
with open('iter.txt') as txt_file:
for txt_line in txt_file:
#
# use end='' to omit printing new-lines
# (The newline is already present in txt_line)
#
print (txt_line, end='')