[Tutor] Return cursor to beginning of line, to overprint, in DOS/windows
Gerrit Holl
gerrit@nl.linux.org
Wed Feb 19 15:34:01 2003
R. Alan Monroe schreef op woensdag 19 februari om 05:09:28 +0000:
> Is there a special backslash code I can use in a print statement to
> move the cursor back to beginning of the line, to keep printing on the
> same line over and over? I tried "\r" but that didn't work.
>
> It seems like this has come up before but I searched my mail archives
> for "carriage" "beginning" "return" etc. and couldn't find it.
Works here:
>
Python 2.3a1 (#1, Jan 5 2003, 16:06:30)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-110)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
0 >>> print "aaa\rb"
baa
What did you try exactly? Remember that 'print' prints a newline
after the expression.
yours,
Gerrit.
--
Asperger Syndroom - een persoonlijke benadering:
http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
http://www.sp.nl/