cyberdyne
cyberdyne

Reputation: 436

In python carriage return \r returns a musical note

print "-------------------\r"

produces a musical note instead doing the carriage return. Why?

Thanks in advance for reply.

EDIT: I was using it in this code in order to change dinamically data by 'print' instead to re-print it all:

import math
import time

    while True:
        reading = read_world_2c(0x43) #it's a function for reading data from a sensor
        print "data:     \r", reading
        time.sleep(0.5) 

Upvotes: 1

Views: 864

Answers (1)

Crowcoder
Crowcoder

Reputation: 11514

That musical note is the symbol for line breaks. If you have MS Word or Notepad++ or similar, open or type some text and then find the menu command for "show nonprinting characters ". You will see those "musical notes" at the end of each line.

Upvotes: 3

Related Questions