In python, is there a built-in way to do a readline() on string? I have a large chunk of data and want to strip off just the first couple lines w/o doing split() on the who
The easiest way for both python 2 and 3 is using string's method splitlines(). This returns a list of lines.
>>> "some\nmultilene\nstring\n".splitlines()
['some', 'multilene', 'string']