this does the same except 100 times faster ?
I don't understand the logic about the prompt, its not the same as the
output from the bash shell ?
[EMAIL PROTECTED]:~# cat ssh2.py
import pexpect
import sys
child = pexpect.spawn("ssh [EMAIL PROTECTED]")
#child.logfile = sys.stdout
i = child.expect(['assword:', r'yes/no'],timeout=120)
if i==0:
child.sendline('123')
elif i==1:
child.sendline('yes')
child.expect('assword:', timeout=120)
child.sendline('123')
child.expect('[EMAIL PROTECTED]: ~')
print child.before
child.sendline('ls -l')
child.expect('[EMAIL PROTECTED]:')
print child.before
child.sendline('su')
child.expect('assword:')
child.sendline('123')
child.expect('[EMAIL PROTECTED]: /srv/www/gert')
print child.before
child.sendline('ls -l')
child.expect('[EMAIL PROTECTED]:')
print child.before
--
http://mail.python.org/mailman/listinfo/python-list