[Tutor] carriage return on windows
Max Noel
maxnoel_fr at yahoo.fr
Sun Jan 30 03:23:56 CET 2005
On Jan 30, 2005, at 02:18, R. Alan Monroe wrote:
>
>> print "Percent completed:" + str(percent) + "\r"
>
> Print forces a newline.
> Try sys.stdout.write instead.
>
> Alan
You can also use the following syntax:
>>> print "Percent completed:", str(percent), "\r",
The trailing comma is NOT a typo, it is intentional. It prevents print
from appending a newline.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
More information about the Tutor
mailing list