Reputation: 61
i want to reboot my rooter using this code:
from pexpect.pxssh import pxssh
s = pxssh.pxssh()
s.login('Adress','username','password')
s.sendline('reboot')
s.prompt()
s.logout
But it's giving me this error:
from pexpect import ExceptionPexpect, TIMEOUT, EOF, spawn
ImportError: cannot import name 'spawn' from 'pexpect' (C:\Users\Hama\AppData\Local\Programs\Python\Python39\lib\site-packages\pexpect\__init__.py)
All what i need is to reboot my rooter one time, that's all, are there other solution to do that under windows 10?
Any help is appreciated, thanks to all of you
Upvotes: 0
Views: 69
Reputation: 1088
Looks like a router waiting for the end of a command. Try to use EOF
or \n
Upvotes: 0