Код: Выделить всё
from pexpect import pxssh
s = pxssh.pxssh()
if not s.login ('myip', 'myusername', 'mypassword'):
print ("SSH session failed on login.")
print (str(s))
else:
print ("SSH session login successful")
s.sendline ('ls -l')
s.prompt() # match the prompt
print (s.before) # print everything before the prompt.
s.logout()
Код: Выделить всё
Traceback (most recent call last):
File "test_pexpect.py", line 1, in
from pexpect import pxssh
File "C:\Python35\lib\site-packages\pexpect\pxssh.py", line 23, in
from pexpect import ExceptionPexpect, TIMEOUT, EOF, spawn
ImportError: cannot import name 'spawn'
Подробнее здесь: https://stackoverflow.com/questions/368 ... sing-pxssh