>>> print '"Hello,\\nworld!"'.decode('string_escape')
"Hello,
world!"
More Related Contents:
- How to understand regular expression with python?
- Why do backslashes appear twice?
- Process escape sequences in a string in Python
- How can I remove the ANSI escape sequences from a string in python
- Escape special characters in a Python string
- How to write string literals in python without having to escape them?
- What does a leading `\x` mean in a Python string `\xaa`
- How can I put an actual backslash in a string literal (not use it for an escape sequence)?
- Adding backslashes without escaping [duplicate]
- How to convert a string in the desired manner?
- How to search and replace text in a file?
- How would you make a comma-separated string from a list of strings?
- How do I trim whitespace from a string?
- Reading a text file and splitting it into single words in python
- Split a string to even sized chunks
- Split string using a newline delimiter with Python [duplicate]
- How to convert an int to a hex string?
- How to generate random strings in Python?
- How do I check if raw input is integer in python 2.7?
- How to replace whitespaces with underscore?
- Print “\n” or newline characters as part of the output on terminal
- How can I check if a string has a numeric value in it in Python? [duplicate]
- How does str.startswith really work?
- Most Efficient Way to Find Whether a Large List Contains a Specific String (Python)
- Python string operation, extract text between html tags
- get python dictionary from string containing key value pairs
- Mutable and Immutable Strings in python
- Why do I get “TypeError: not all arguments converted during string formatting” trying to substitute a placeholder like {0} using %?
- Length of longest word in a list
- Detect whether a Python string is a number or a letter [duplicate]