[paramiko] Problem using channels
Todd Whiteman
toddw at activestate.com
Fri Dec 7 17:55:33 PST 2007
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