On 9/11/2013 8:08 AM, Fábio Santos wrote:
Is there not a limit argument to str.split? This should be trivial.
Yes, I posted an example using it the first day. I also showed how to use iter and next with files and avoid copying.
first, rest = multiline_str.split('\n', 1)
This does not work right is there is no '\n' Then someone pointed out first, dummy, rest = partition('\n') which does work with no '\n' -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list