by splitting with newlines.
for line in wallop_of_a_string_with_many_lines.split('\n'):
#do_something..
if you iterate over a string, you are iterating char by char in that string, not by line.
>>>string = 'abc'
>>>for line in string:
print line
a
b
c