用 codecs, 大概是這樣子:
codecs
# python3 code import codecs print(codecs.getdecoder("unicode_escape")('first line second line """')[0])
結果:
first line second line """