fwu
fwu

Reputation: 369

Python os.waitpid throw `[Errno 10] No child processes`

Following code return with [Errno 10] No child processes on windows platform (python version 2.7.2).

import subprocess
import os
pid = subprocess.Popen(["cmd"]).pid
os.waitpid(pid, 0)
print 'process %d finished' % pid

The same code works well on Linux.

Upvotes: 0

Views: 4166

Answers (1)

mrbox
mrbox

Reputation: 824

Maby this will work- but I have no idea, why your code isn't working on Windows- everything looks fine:

import subprocess
subp = subprocess.Popen(["cmd"])
subp.wait()
print 'process %d finished' % subp.pid

Upvotes: 3

Related Questions