读书人

python 过程

发布时间: 2012-07-22 19:31:17 作者: rapoo

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)
?

读书人网 >perl python

热点推荐