import multiprocessing,threading def my(): print('哈哈哈') def run(num): for i in range(num): t=threading.Thread(target=my) t.start() if __name__ =='__main__': for i in range(5): p=multiprocessing.Process(target=run,args=(6,))#启动一个进程 p.start()
import multiprocessing,threading def my(): print('哈哈哈') def run(num): for i in range(num): t=threading.Thread(target=my) t.start() if __name__ =='__main__': for i in range(5): p=multiprocessing.Process(target=run,args=(6,))#启动一个进程 p.start()