标签:multi lis def 子进程 name [] main int start
import time from multiprocessing import Process def f1(): time.sleep(0.5) print(‘xxx‘) if __name__ == ‘__main__‘: p_list = [] #for循环创建子进程,并且完成主进程等待所有子进程执行结束,才继续执行 for i in range(10): p = Process(target=f1,) p.start() p_list.append(p) p.join() # for pp in p_list: # pp.join() print(‘主进程结束‘)
标签:multi lis def 子进程 name [] main int start
原文地址:https://www.cnblogs.com/demons97/p/10267347.html