python中的换行符


--------------python2 IDE中------------------

>>> print 'helo\nme'

helo

me

>>> print 'hello\rme'

hello me

>>> print 'hello\r\nme'

hello

me

>>>

------------------python2命令行中------------------

>>> print 'hello\nme'

hello

me

>>> print 'hello\rme'

mello

>>> print 'hello\r\nme'

hello

me

>>>

-----------------------bash中--------------------

root@bottle-king:~# echo 'hello\nme'

hello\nme

root@bottle-king:~# echo -e 'hello\nme'

hello

me

root@bottle-king:~# echo -e 'hello\rme'

mello

你可能感兴趣的:(python中的换行符)