I'm doing something along these lines:
"""Check if the task is finished and clean up."""
(pid, status) = os.waitpid(self._pid, os.WNOHANG) ## clean up the zombie
assert(pid == self._pid)
if os.WIFEXITED(status) or os.WIFSIGNALED(status):
self._pid
Laszlo Zsolt Nagy wrote:
>This function:
>
>def scp(from_path,to_path,pwd):
>"""Copy a file with scp."""
>cmd = '/bin/csh -c "scp -q %s %s ; echo XXX"' %(from_path,to_path)
>print cmd
>child = pexpect.spawn(cmd)
>child.expect('Password:')
>child.sendline(pwd)
>child
This function:
def scp(from_path,to_path,pwd):
"""Copy a file with scp."""
cmd = '/bin/csh -c "scp -q %s %s ; echo XXX"' %(from_path,to_path)
print cmd
child = pexpect.spawn(cmd)
child.expect('Password:')
child.sendline(pwd)
child.expect('XXX')
return child.exi