Skip to content

Commit b4038ed

Browse files
committed
Fixed #43 using subprocess Popen and writing with tqdm.write
1 parent 67524ad commit b4038ed

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Interlace/lib/threader.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ def __call__(self):
1919
if self.tqdm:
2020
self.tqdm.update(1)
2121
# run task
22-
self.run_task(task)
22+
self.run_task(task, self.tqdm)
2323
except IndexError:
2424
break
2525

2626
@staticmethod
27-
def run_task(task):
28-
subprocess.call(task, shell=True)
27+
def run_task(task, t):
28+
s = subprocess.Popen(task, shell=True, stdout=subprocess.PIPE)
29+
t.write(s.stdout.readline().decode("utf-8"))
2930

3031

3132
class Pool(object):

0 commit comments

Comments
 (0)