str.split() function does the same: >>> s = "line1\nline2\rline3\r\nline4\vline5\x1dhello" >>> s.split() ['line1', 'line2', 'line3', 'line4', 'line5', 'hello'] >>> s.splitlines() ['line1', 'line2', 'line3', 'line4',…
str.split() function does the same: >>> s = "line1\nline2\rline3\r\nline4\vline5\x1dhello" >>> s.split() ['line1', 'line2', 'line3', 'line4', 'line5', 'hello'] >>> s.splitlines() ['line1', 'line2', 'line3', 'line4',…