import os, sysr, w = os.pipe()pid = os.fork()if pid: os.close(w) r = os.fdopen(r) txt = r.read() os.waitpid(pid,0)else: os.close(r) w = os.fdopen(w,'w') w.write('hello from server') w.close() print 'child exit' sys.exit(0)print 'all over'
沒有留言:
張貼留言