将带有转义字符的字节字符串转换为普通字符串

Converting bytes string with escape characters into a normal string

有数百万个与此相关的问题和答案,但对我没有任何帮助。

我有一个包含转义字符的字节字符串,我想对其进行解码并将其转换为字符串,但不包含转义字符,打印时将如下所示

>>> normal_string = "Hello\r\nWorld"
>>> print(normal_string)
Hello
World

这是我的字节串的一部分

>>> bytes_string = b'Normal sentence\r\n\tIndented sentence\r\nanother one'
>>> converted_string = str(bytes_string, 'utf-8')
>>> print(converted_string)
Normal sentence\r\n\tIndented sentence\r\nanother one

我想要这个

>>> print(string_that_I_want)
Normal sentence
    Indented sentence
another one
>>> print(bytes_string.decode("unicode_escape"))
Normal sentence
    Indented sentence
another one
>>>