[Tutor] Writing to the terminal?

Hugo Arts hugo.yoshi at gmail.com
Fri Dec 10 22:28:47 CET 2010


On Fri, Dec 10, 2010 at 9:38 PM, Corey Richardson <kb1pkl at aim.com> wrote:
>
> Try that in the interactive interpreter, it doesn't work.
>>>> print "a" + chr(13)
> a

You forgot to print something after the carriage return. It works for me:

Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'a'+chr(13)+'b'
b
>>>

the carriage return resets the cursor to the beginning of the line, so
you can write over what you wrote before.

Hugo


More information about the Tutor mailing list