转义字符在大部分语言中意思是一样的,下面列出各转义字符的含义:
\n 换行,相当于按下Enter键
\t 制表符,相当于按下Tab键
\r
回到行首(\r is a carriage return character; it tells your terminal emulator to move the cursor at the start of the line. The cursor is the position where the next characters will be rendered.)
\a 发出响声(\a is a beep)。及python code: "print '\a'"执行时会发出一声响.注意:Python和C语言中,print几个连续的\a,只会产生一声声响。
\f 换页符(form feed)。可能对于打印机有用,对于电脑终端没有此效果(在有些系统的终端上,会显示一个头朝上的手榴弹形状)。它是一个:white space.