python - What does this stand for? -


what '\r' mean? do? have never seen before , giving me headaches. doesnt seem have purpose, since 'a\ra' prints 'aa', not same string 'aa'. im using python 2.6

it's old control character typewriters. means "carriage return". in time, when pressed "enter", going next line, carriage went beginning of line (hence carriage return). computers, different oses made different choices represent new lines. on windows, have "\r\n" (carriage return + new line). on unices, have "\n" (no need carriage return, sort of implied new line). on old mac os, had "\r" only.

nowadays, it's not used except newlines (or don't know other usages).


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -