casting raw strings python [duplicate]

Python 3:

"hurr..\n..durr".encode('unicode-escape').decode()

Python 2:

"hurr..\n..durr".encode('string-escape')

Leave a Comment