pexpect parse router output
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 et
h i sApologies 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 c开发者_StackOverflow社区an this be resolved???
OK fixed - due to pexpects handling of line endings (/n/r) I think. Read Noahs usage docs for more info
精彩评论