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
Post a Comment