[paramiko] Problem using channels
Heine Andersen
heine.andersen at gmail.com
Sat Dec 8 17:09:01 PST 2007
Must have been late last night, using readline works like a charm, thx !
On Dec 8, 2007 2:55 AM, Todd Whiteman <toddw at activestate.com> wrote:
> Heine Andersen wrote:
> > Hi,
> >
> > I'm trying to create a program that log in to a chain of hosts, and
> > setup the users keys,
> > to do this job I have created a recursive program, but the problem is
> > that i only work for the first host i log in to.
> >
> > this is just a snip to show my problem,
> >
> >
> > password = sys.stdin.read()
> > password = password.strip(" \n")
> >
>
> sys.stdin.read() will read all of the input (multiple lines) in one go.
>
> The next time the code loops, it blocks at the sys.stdin.read() call,
> but there is no more data to read. You might want to use
> sys.stdin.readline() instead.
>
> Cheers,
> Todd
>
More information about the paramiko
mailing list