Escape Sequence in Python
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)
\r ASCII Carriage Return (CR)
\t ASCII Horizontal Tab (TAB)
\uxxxx Character with 16-bit hex value xxxx (Unicode only)
\Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (Unicode only)
\v ASCII Vertical Tab (VT)
\ooo Character with octal value ooo
\xhh Character with hex value hh
Reference: Learning python the hard way
本文详细介绍了Python中使用的各种转义序列及其作用,包括用于表示特殊字符的序列,如单引号、双引号等,以及ASCII控制字符,如换行、制表符等,并涉及了Unicode字符的表示方法。
4931

被折叠的 条评论
为什么被折叠?



