I am receiving an XML response from an API in a variable r so that:
print r.read()
displays the entire XML response.
I need to take the first line of this response and convert it to a string variable for use in a loop after some substringing. What is the best way to capture just the first line?
r.readline()Built-in Types – File Objects: