How do I simulate a progress counter in a command line application in Python?
Posted
by CRP
on Stack Overflow
See other posts from Stack Overflow
or by CRP
Published on 2010-04-22T08:18:22Z
Indexed on
2010/04/22
8:33 UTC
Read the original article
Hit count: 150
python
|command-line
My Python program does a series of things and prints some diagnostic output. I would also like to have a progress counter like this:
Percentage done: 25%
where the number increases "in place". If I use only string statements I can write separate numbers, but that would clutter the screen. Is there some way to achieve this, for example using some escape char for backspace in order to clear a number and write the next one?
Thanks
© Stack Overflow or respective owner