[Tutor] REG : Pexpect timeout issue

krishna chaitanya rkc_chaitu at yahoo.co.in
Sat Sep 1 07:41:42 EDT 2018


Hi Team,
Below is my code, i am frequently hitting timeout issue to login to linux or router.
import pexpectfrom pexpect import *child = spawn('su xxxxx',timeout = 50)child.expect('Password:',timeout = 50)child.sendline('XXXXXXX')#child.sendline('ls -l')#chasis = child.before.decode('utf-8')child.expect('krishna at krishna-desktop:~/python_excercises$',timeout = 50)child.sendline('ls -l')chasis = child.before.decode('utf-8')print(chasis)
Error :
    raise TIMEOUT(msg)pexpect.exceptions.TIMEOUT: Timeout exceeded.<pexpect.pty_spawn.spawn object at 0x7f068506fa20>

Please guide me.
Krishna.



More information about the Tutor mailing list