I'm trying to print a multiple line string to a Jupyter notebook. The problem is that \r and \n are printed literally and not interpreted as newlines.
Example:
import os
os.linesep.join(['first line', 'second line'])
I would expect this to print:
first line
second line
But it prints:
first line\r\nsecond line
You need to actually print
it.
import os
print(os.linesep.join(['first line', 'second line']))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With