擅长:python、mysql、java
<p>从另一个进程运行子进程,该进程的唯一任务是等待它。你知道吗</p>
<pre><code>pid = os.fork()
if pid == 0:
s = Popen('cat', stdin=PIPE, stdout=DEVNULL, stderr=DEVNULL)
s.stdin.write(b'helloworld')
s.stdin.close()
s.wait()
sys.exit()
time.sleep(1000)
</code></pre>