3 ms·
If it's reading from a file, you wouldn't be using splitlines() anyway; you'd use readlines(). For string you’d need to import io for line in io.StringIO
by paulddraper 1y ago
If it's reading from a file, you wouldn't be using splitlines() anyway; you'd use readlines().
For string you’d need to
import io
for line in io.StringIO(str):
pass