[Tutor] pexpect

James jtp at nc.rr.com
Sat Sep 20 17:43:09 CEST 2008


Folks,

Does anyone here have experience with pexpect? I'm trying to write a
pexpect script which will log into a network device, gather
statistics, and then dump the raw output into a file (or a string so
that I can manipulate it).

I'm not having much luck. Because the connection is telnet I was able
to use wireshark (a sniffer) to see the traffic between my computer
(which is running the pexpect script) and the network device.
Everything seems to go find until I "expect" the network device's
prompt and it just hangs. Eventually pexpect throws an exception and
times out.

I'd be happy to share some code when I get to the computer I've been
testing on. :) In the time being, has anyone seen a problem like this
before?

Thanks!
-j


More information about the Tutor mailing list