In python3 I am using subprocess.check_output
to get the output from a command, but when I print it it looks something like
b'first line\nsecond line\nthird line'
How can I easily 'convert' that to something like the following:
first line
second line
third line
I tried the following code:
for line in output.split(b'\n'):
print(line)
but got the following output:
b'first line'
b'second line'
b'third line'
How to do it correct (and probably in one short line)?