For example.
Python 2.4 (#Stuff) ...
Percent complete: 50
becomes...
Python2.4(#Stuff) ...
Percent complete: 51
so that the whole line is overwritten. In my experience, this is not possible and if anyone can show me how to do it,
I would be grateful.
HTH, Jacob
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?"
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor