My script returns text in a weird way, and i need to trim it so it becomes readable.
This is an example of the return text:
b'\r\nR5#'b'e'b'n'b'\r\n'b'R5#'b'c'b'o'b'n'b'f'b' t'b'\r\n'b'Enter configuration commands, one per line. End with CNTL/Z.\r\nR5(config)#'b'h'b'o'b's'b't'b'n'b'a'b'm'b'e'b' 'b'R'b'5'b'\r\n'b'R5(config)#'
This is how the text should appear, with line breaks and without the 'b'\r\n:
R5#en
R5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#hostname R5
R5(config)#
How can i trim/split this correctly in Python?