Progress Bars in python

H

Hari Sekhon

Hi,
I've written a script which backs up a huge bunch of files, but I
don't want the script to output the file names as it does this as it
clutters the screen, I only output errors.

So in order to see that the script is working and not stuck, I'd like to
implement some kind of progress bar or something, perhaps like the
spinning thing that you often see in linux or freebsd consisting of
switching / - \ | on the spot to get the appearance of a spinning
bar.... I can figure out that the spinning bar is done by switching
these four chars but I don't know how they get each char to replace the
last one instead of printing them in succession.

Does anybody have any good suggestions about what the best way of doing
this or any other suggestions for the best ways to show that the script
is processing...?


Hari
 
L

Larry Bates

Hari said:
Hi,
I've written a script which backs up a huge bunch of files, but I
don't want the script to output the file names as it does this as it
clutters the screen, I only output errors.

So in order to see that the script is working and not stuck, I'd like to
implement some kind of progress bar or something, perhaps like the
spinning thing that you often see in linux or freebsd consisting of
switching / - \ | on the spot to get the appearance of a spinning
bar.... I can figure out that the spinning bar is done by switching
these four chars but I don't know how they get each char to replace the
last one instead of printing them in succession.

Does anybody have any good suggestions about what the best way of doing
this or any other suggestions for the best ways to show that the script
is processing...?


Hari

This also is shown in Python Cookbook:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207

Larry Bates
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top