Expect on window (from python script)

Eddie Corns eddie at holyrood.ed.ac.uk
Mon Mar 3 13:29:20 EST 2003


claird at lairds.com (Cameron Laird) writes:

>You wrote me that
>              child = pexpect.spawn('telnet xp-1')
>              exp = child.expect('login: ')
>              # till here all o.k
>              child.sendline('tester')
>              # Here start the problem :
>              # the expect got only the first
>              # cur from the word "tester"
>              # instead of sending the whole
>              # word and wait for the xp-1:password: line.

It occurs to me to wonder if sendlines behaviour of adding just linefeed is
enough and maybe sending 'tester\n' might work.  I think a telnet client is
supposed to handle this transparently but it might be worth a try.

Eddie




More information about the Python-list mailing list