Suppose I have a string as follows (after parsing some stdout): >>> mystr '--More-- \r \rSerial-Number: 12345' I notice that print() function automatically processes the \r characters, essentially getting rid of the entire "--More--" part, like this: >>> print(mystr) Serial-Number: 12345 How can I achieve the same result in a variable? In other words, I'd like to get a string variable newStr, so that: >>> newStr Serial-Number: 12345 Continue reading...