Python中的轉義字元

pythontab發表於2014-02-20

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的字元


相關文章