python turn non printable character to escape string code example
Example: python turn non printable character to escape string
text_to_print = repr(text_with_newlines_and_other_things)
print(text_to_print)
# example
>>> print("hi\nthere")
hi
there
>>> print(repr("hi\nthere"))
'hi\nthere'