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
in Python string have method splitlines
msg = "Bob Smith\nJane Doe\nJane,\nPlease order more widgets\nThanks,\nBob\n" msg_splitlines = msg.splitlines() headerTo = msg_splitlines[0] headerFrom= msg_splitlines[1] sendMessage(headerTo,headerFrom,msg)