来源(PythonTab:Python中文开发者社区门户)

From: http://www.pythontab.com/html/2014/pythonjichu_0220/700.html

Python中的转义字符

2014-02-20 09:29:05 来源:

EscapeWhat it does 含义 Backslash ()反斜杠 & 39;Single-quote (& 39;)单引号 "Double-quote (")双引号 aASCII bell (BEL)响铃符

Escape What it does. 含义

\\ Backslash () 反斜杠

\' Single-quote (') 单引号

\" Double-quote (") 双引号

\a ASCII bell (BEL) 响铃符

\b ASCII backspace (BS) 退格符

\f ASCII formfeed (FF) 进纸符

\n ASCII linefeed (LF) 换行符

\N{name} Character named name in the Unicode database (Unicode only) Unicode数据库中的字符名;name就是它的名字

\r ASCII Carriage Return (CR) 回车符

\t ASCII Horizontal Tab (TAB) 水平制表符

\uxxxx Character with 16-bit hex value xxxx (Unicode only) 值为16位十六进制xxxx的字符

\Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (Unicode only) 值为32位十六进制xxxx的字符

\v ASCII vertical tab (VT) 垂直制表符

\ooo Character with octal value ooo 值为八进制ooo的字符

\xhh Character with hex value hh 值为十六进制数hh的字符

Link: http://www.asm32.net/article_details.aspx?id=6243