(我是Python的新手......)
我有一个需要并行运行的方法。
它运行良好,但是当方法结束时,没有任何反应......并且不会调用下一行。
q = Queue.Queue()
for driver in drivers:
t = threading.Thread(target=DoSomeStuff, args=(args.build, driver))
t.daemon = True
t.start()
s = q.get()
print s
答案 0 :(得分:0)
代码的工作是:
drivers = ["a", "b", "c"]
threads = []
for driver in drivers:
t = threading.Thread(target=DoSomeStuff, args=(driver))
threads.append(t)
t.start()
for t in threads:
t.join()