How to check if Pexpect child already exist?

Thomas Elsgaard thomas.elsgaard at gmail.com
Wed Dec 5 08:41:23 CET 2012


Hi List

I am wondering, how can i check if child already exist before i spawn
? child.isalive() cannot be done on child before it has been spawned.

---
import pexpect

child=pexpect.spawn('ssh mysurface at 192.168.1.105')
child.sendline('test')
---

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121205/3d4cb3f7/attachment.html>


More information about the Python-list mailing list