首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

python 过程

2012-07-22 
python 进程import timeimport os, sysdef handleChild(chNum):  time.sleep(20)  print Hi, Im child

python 进程

import timeimport os, sysdef handleChild(chNum):  time.sleep(20)  print "Hi, I'm child ", chNum  os._exit(0)if __name__ == '__main__':  for i in range(5):    childPid = os.fork()    if childPid == 0:      handleChild(i)    else:      print "Hi, I'm father, fork ", i  time.sleep(40)
?

热点排行