Fixed #43 using subprocess Popen and writing with tqdm.write

This commit is contained in:
prodigysml
2019-06-03 22:02:55 -07:00
parent 67524ad053
commit b4038eda2c

View File

@@ -19,13 +19,14 @@ class Worker(object):
if self.tqdm:
self.tqdm.update(1)
# run task
self.run_task(task)
self.run_task(task, self.tqdm)
except IndexError:
break
@staticmethod
def run_task(task):
subprocess.call(task, shell=True)
def run_task(task, t):
s = subprocess.Popen(task, shell=True, stdout=subprocess.PIPE)
t.write(s.stdout.readline().decode("utf-8"))
class Pool(object):