[BangPypers] Display progress as cmd is executed subproces?

Ramanathan Muthaiah rus.cahimb at gmail.com
Mon Jun 13 07:15:12 EDT 2016

Hello All,

Am aware of the module called 'progressbar' that can do this magic of
displaying progress as the cmd is executed.
In fact, I have a test code to show progress and tried, it works.

<progressbar code snippet>

from progressbar import *
import time

def main():
        progress = ProgressBar()
        for num in progress(range(80)):

if __name__ == '__main__':

And, I have this piece of code that executes set of cmds stored in 'cmd'
This too works without any issues until now.

                 dlog = subprocess.check_output([cmd],
stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError, e:
                dlog = e.output


Am lost as to how to combine the progressbar and subprocess code snippets
to show the progress as the cmd is being executed.

Any ideas on how this can be done ?


More information about the BangPypers mailing list