[Tutor] Obtaining result from a sendline
D.Wilder at F5.com
Wed Oct 31 02:47:06 CET 2012
Okay, file this under RTFM, but even after research, I cannot figure out the answer to this simple question.
When I do an ssh in python (version 2.7.3) to a device, I am trying to capture the output of the command.
However, all I get back is a numerical value. I am looking to get the actual output from the "ls /var/tmp"
command below. This is probably readily available info, but I am just not searching on the python sites correctly.
(Pdb) ssh = sshClient.pxssh()
(Pdb) ssh.login(server=ip_addr, username=user, password=pswd)
(Pdb) str = ssh.sendline('ls /var/tmp')
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor