Python 3:
"hurr..\n..durr".encode('unicode-escape').decode()
Python 2:
"hurr..\n..durr".encode('string-escape')
More Related Contents:
- Empty string python zapier
- How do I concatenate items in a list to a single string?
- Fast punctuation removal with pandas
- Converting integer to string in Python
- Checking whether a string starts with XXXX
- Find the nth occurrence of substring in a string
- Stripping non printable characters from a string in python
- How can I check if character in a string is a letter? (Python)
- How can I convert each item in the list to string, for the purpose of joining them? [duplicate]
- Removing a list of characters in string
- Python __str__ versus __unicode__
- Get last “column” after .str.split() operation on column in pandas DataFrame
- How can I tell if a string repeats itself in Python?
- subprocess “TypeError: a bytes-like object is required, not ‘str'”
- How does the max() function work on list of strings in python?
- Removing control characters from a string in python
- How to get char from string by index?
- Format string dynamically [duplicate]
- Converting a string that represents a list, into an actual list object
- How to search if dictionary value contains certain string with Python
- How to concatenate (join) items in a list to a single string
- How do I wrap a string in a file in Python?
- How can I use f-string with a variable, not with a string literal?
- Using Python’s Format Specification Mini-Language to align floats
- How to write multiple strings in one line?
- f.read coming up empty
- How can I check if a string has a numeric value in it in Python? [duplicate]
- How does str.startswith really work?
- Python string operation, extract text between html tags
- Detect whether a Python string is a number or a letter [duplicate]