Command Line Progress Bar

peter pjmakey2 at
Wed Dec 26 12:06:02 CET 2012

On 12/26/2012 03:17 AM, Kevin Anthony wrote:
> Hello,
> I'm writing a file processing script(Linux), and i would like to have 
> a progress bar.  But i would also like to be able to print messages. 
>  Is there a simple way of doing this without implementing something 
> like ncurses?
> -- 
> Thanks
> Kevin Anthony
> <>
> Do you use Banshee?
> Download the Community Extensions:
I use this tecnique to make a progress bar in the console.
You just need to understand, that a progress bar is a 

import sys, time

def progressbar(value, total):
     maspro = (100*value) / total
     sys.stdout.write('\r[%s]%d%%' % ('#'*(maspro/10), maspro))

for a in range(1, 1000):
     progressbar(a, 100)

You can't combine your progress bar with threading module

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list