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.read()give you the whole string, which you could split by line breaks? (I never used python but I expect you could loop through each character until you reach a line break character if you must...)