A little help with pexpect

Piet van Oostrum piet at cs.uu.nl
Sun Jul 19 13:08:58 EDT 2009


>>>>> Piet van Oostrum <piet at cs.uu.nl> (PvO) wrote:
[snip]
>PvO> You can also consider using paramiko instead of pexpect. 
[snip]
>>>>> chan = t.open_session()
>>>>> chan.exec_command('cat')
>>>>> chan.send('abcdefghijklmn\n')

In a real program it is better to use sendall here, as send may decide
to send only part of its argument (the result will tell how many bytes
have been sent).
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list