[Tutor] Printing the Carriage return character

Hans Dushanthakumar Hans.Dushanthakumar at navman.com
Mon Feb 20 04:20:53 CET 2006


Hi,
   Not sure if this is a python thing or a Operating system peculiarity,
but here goes:
Why does the line
print "FirstLine" + "\rSecondLine"
produce different output when run via IDLE and when run in the python
prompt (both under Windows XP)?

Output in IDLE (ver 1.1.1, python 2.4.1):
>>> print "FirstLine" + "\rSecondLine"
FirstLine
SecondLine
>>> 

Output at the python prompt (python 2.4.1):
C:\QVCS\Mobile Data\>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "FirstLine" + "\rSecondLine"
SecondLine
>>>

Cheers
Hans


More information about the Tutor mailing list