What does "\ r" mean? What does it do? I had never seen this before, and it gave me headaches. This does not seem to have any purpose, since "a \ ra" prints as "aa", but this is not the same as the string "aa". Im using python 2.6
This is an old control character from typewriters. This means "carriage return." At this time, when you pressed enter, you went to the next line, then the carriage returned to the beginning of the line (hence, carriage return). Then with computers, different operating systems made different options for presenting new lines. In windows you have "\ r \ n" (carriage return + new line). In Unices you only have "\ n" (there is no need to do a carriage return, this was due to a new line). On old Mac OS, you only had "\ r".
Currently, it is not used, except for newlines (or I do not know other ways to use it).
For me (on Mac OS X 10.5 Terminal.App, Python 2.6.5):
>>> print 'a\ra' a
or give a better example:
>>> print 'longstring\rshort' shorttring
IOW, \r " " ( ), 'short' "" 'longstring'.
\r
'short'
'longstring'
" ", - print '\rupdate', , , . , , , , , ( ).
print '\rupdate',
, ( , \r , ), ! -)
. , Windows, print 'a\ra' ...
print 'a\ra'
a a
... .
.
\newline
\\
\'
\"
\a
\b
\f
\n
\N{name}
\t
\uxxxx
\Uxxxxxxxx
\v
\ooo
\xhh
there should be a carriage return ... something like a new line ... look at http://www.wilsonmar.com/1eschars.htm
Source: https://habr.com/ru/post/1756436/More articles:What is the best way to create a connection between trains and tracks? - oopProblems decoding a file strictly using Binary in Haskell - ioConfigure MSMQ for clustering - cluster-computingJava Compiler in Ubuntu - javaотслеживание пользователей с помощью Google Analytics после того, как они покинут мой домен, чтобы совершить покупку и вернуться - google-analyticsThe same JavaScript function returns random results - javascriptJquery checks if element is hidden (continuously) - functionUnexpected JavaScript behavior error - javascriptC ++ ifstream UTF8 first characters - c ++Testing FPS with the Android Eclipse Plugin? - androidAll Articles