[paramiko] How do I execute multiple commands in a singlechannel?

james bardin jbardin at bu.edu
Tue Mar 31 14:01:44 PDT 2009


On Tue, Mar 31, 2009 at 10:25 AM, Eric Noulard <eric.noulard at gmail.com> wrote:

>> James B: do you have a clear idea of how to add expect-like behavior
>> to paramiko?  Do you need help doing this?  I'm just curious, I don't
>> know if I'd have to time the spend on it but it sure seems like an
>> interesting problem.
>
> I'm pretty interested in this too.
> Not that regarding the way to handle "expect-like" thing would be to
> "port" pexpect to use paramiko.
>
> Whatever the way you want to, expect-like feature needs some
> "event" handling things on the channel WITH timeout feature.
>

My original idea was to avoid most of the event handling, and do
simple string matching like telnetlib, but in the end I decided I
didn't like the hack. Implementing a "real" expect system would be
more interesting, but I would want to dig into pexpect first, and see
what problems there are with using it directly. I assume there would
be the same issues when trying to replicate the functionality in
paramiko. I've really never needed to use pexpect (or even good ol'
expect for that matter).

-jim



More information about the paramiko mailing list