Pages Navigation Menu

"It's not about the destination, it's about the journey. "

Escape sequences (Python)

Just typing these out so I can remember these escape sequences: (Even though I don’t know what they mean… yet.)

\\  – Backslash()

\’    – Single quote (‘)

\”   – Double quote (“)

\a   – ASCII Bell (BEL)

\b  – ASCII Backspace (BS)

\f   – ASCII Formfeed (FF)

\n  – ASSII 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 0oo

\xhh  – Character with hex value hh

From Exercise 10 of Learn Python The Hard Way.