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