Question

I've got a couple of pexpect lines to log onto a cisco router, and issue the show arp command. I then exit the router, having stored the data into the variable myARP (myARP=child.before)

When I then try and loop over the object (for lines in myARP: print(lines), the info is displayed 1 character per line
l
i
k
e

t
h
i
s

Apologies as this is probably a very basic question, but why can't I display as it is shown if I issue the command manually? Is it to do with the streaming nature of the telnet connection? How can this be resolved???

Was it helpful?

Solution

OK fixed - due to pexpects handling of line endings (/n/r) I think. Read Noahs usage docs for more info

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top