Take the 2-minute tour ×

I am working on Python and have been experimenting with the escape sequences \v and \f. The output seems to be giving strange symbols where I put these 2 escape sequences. I am not able to post the image of the output due to some spam prevention policies by the website. Could someone give any ideas as to what could be the problem. Thanks.

share|improve this question
I just figured it out. It seems that \f was designed primarily for old printers to signal some instruction that the page was to be changed etc. It is almost obsolete now. Hence the strange symbols. –  Nitin Jul 12 '12 at 8:14
add comment

1 Answer

Escape-sequences are documented here:

\v is a vertical tab
\f is a form feed

If you print them in the REPL you get the hexadecimal value (0c).

>>> '\f'

As with some other conventions, the \x escape-sequence is inherited from C.
Reference: http://www.python.org/dev/peps/pep-0223/

If you prefer the ASCII code to the hex code you can use ord():

>>> ord('\f')
share|improve this answer
add comment

Your Answer


