Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the same line eg.
while working:
print percent
On Sun, Mar 8, 2009 at 1:37 AM, Daniel Dalton d.dal...@iinet.net.au wrote:
Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I
On Sun, 8 Mar 2009 01:59:03 -0800
Chris Rebert c...@rebertia.com wrote:
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the same line eg.
Use the carriage return character to overwrite the line (you'll need
to forego `print`):
Why do you say
Daniel Dalton d.dal...@iinet.net.au wrote:
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the
Chris Rebert wrote:
On Sun, Mar 8, 2009 at 1:37 AM, Daniel Dalton d.dal...@iinet.net.au wrote:
Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output...
or like this:
print '\r'+str(percent),
Then make sure it gets sent out, like this:
sys.stdout.flush()
Hey!
Thanks very much, that did the trick!
Thanks to everyone that replied, I discovered converting to str was
crutial to actually print anything. :)
Cheers,
Daniel.
--