1

In Python's module named string, there is a line that says whitespace = ' \t\n\r\v\f'.

  • ' ' is a space character.
  • '\t' is a tab character.
  • '\n' is a newline character.
  • '\r' is a carriage-return character.

  • '\v' maps to '\x0b' (11). What does it mean and how might it be typed on a keyboard (any OS)?
  • '\f' maps to '\x0c' (12). What does it mean and how might it be typed on a keyboard (any OS)?
Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Noctis Skytower
  • 21,433
  • 16
  • 79
  • 117

3 Answers3

2

\v is a vertical tab

\f is a formfeed

See: Escape Sequences

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
2

\v is a vertical tab. It was used in line printers to advance about 6 lines or so. It can be typed in *nix by pressing Ctrl-V Ctrl-K.

\f is a formfeed. It was used in line printers to advance to the next page. It can be typed in *nix by pressing Ctrl-V Ctrl-L.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
2

Per wikipedia:

12 (form feed, \f, ^L), to cause a printer to eject paper to the top of the next page, or a video terminal to clear the screen.

^L means Control-L on most keyboards and OSes.

\v, code 11 (typeable as ^K) is essentially obsolete, while ^L is still occasionally used (e.g in vi to "refresh/repaint the screen" rather than just "clearing" it as in the original meaning).

Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395