multithreading - python: subprocess.call threads problem -
hello people within while true processing never ends, if use q.task_done, wrong?
filequeue = queue() def submit(i, q): global filespath while true: filename = q.get() retvt = subprocess.call("python abc.py -f %s" % (filespath + filename), shell=true, stdout=open('/dev/null', 'w'), stderr=subprocess.stdout) retth = subprocess.call("python def.py -a %s" % (filename), shell= true, stdout=open('/dev/null', 'w'), stderr=subprocess.stdout) q.task_done() def main(): global filequeue
num_threads = filequeue.qsize() in range(num_threads): worker = thread(target=submit, args=(i, filequeue)) worker.setdaemon(true) worker.start() filequeue.join()
print "done"
if name == 'main': main()
thanks
what program listings abc.py , def.py? sure commands executing ever end? try running 2 subprocess.call() lines commented out , see if works intended. if works, problem somewhere related scripts you're calling outside of code.
Comments
Post a Comment