python-10多进程
1-多进程(multiprocessing),1个父进程可以有多少子进程
from multiprocessing import Process import os def run_proc(name): print('Run child process %s (%s)' % (name,os.getpid())) #父进程的ID if __name__ =='__main__': print('Parent process %s. ' % os.getpid()) p = Process(target=run_proc, args=('test', )) print('Child process will start') p.start() #开始进程 p.join() #待子子进程结束 print('Child process end')
相关推荐
容数据服务集结号 2020-05-19
天空一样的蔚蓝 2020-04-25
zhichengangle 2020-04-20
iamplane 2020-04-20
CloudXli 2020-04-07
oXiaoChong 2020-04-07
mieleizhi0 2020-03-28
学习备忘录 2020-02-18
GhostLWB 2020-02-13
zhaowj00 2020-02-01
jacktangj 2020-01-31
assastor 2020-01-23
xiaoxiaokeke 2020-01-14
xiaof 2020-01-12
Yellowpython 2020-01-11
weiguoxin 2020-01-05
阿艾辣悟叩德 2020-01-04
sarsgetaway 2013-06-01