from multiprocessing import Process import time def f ( i ): time . sleep ( 1 ) print ( "Say:" , i ) if __name__ == "__main__" : for i in range ( 10 ): t = Process ( target = f , args = ( i ,)) t . daemon = False #这样的意思是等待子进
import time
def f(i):
time.sleep(1)
print("Say:",i)
if __name__=="__main__":
for i in range(10):
t=Process(target=f,args=(i,))
t.daemon=False #这样的意思是等待子进程,如果是true是不等待子进程
t.start()
print("End")