Python 3 showing progressbar while subprocess.Popen

Have an interesting case I want to share and save for future. One small problem in this system: https://github.com/trianglesis/BMC_TPL_IDE is showing when some process is running and was not hanged up. Sometimes we need to run a huge amount of checks and tests and would be great to know if something hangs before killing it mannually. I used different scenarios and mostly a module pregressbar2, and this is what I finally can compose: Make worker which will execute job sorf of randomly: import time import random print(“START SOMETHING”) for i in range(5): sec = random.randint(1, 3) print(“Sleeping for: %d” % sec) time.sleep(sec) print(“Making job, line: %d” % i) print(“END SOMETHING”) Make process executor: import sys import subprocess import progressbar # DrawShort Read more…