[Tutor] Capturing and parsing over telnet
david at abbottdavid.com
Sun Nov 30 10:26:42 CET 2008
Stephen Nelson-Smith wrote:
> I want to write a program that connects to a TCP port using telnet,
> and issues commands, parsing the output the command provides, and then
> issuing another command.
> This might look like this:
> $ telnet water.fieldphone.net 7456
> Welcome to water, enter your username
>> _ sheep
> Enter your password
>> _ sheep123
>> _ examine here
> [some info to parse]
>> _ some command based on parsing the previous screen
> [more info to parse]
> I am confident I can parse the info, if I can read it in.
> I am not sure how to handle the telnet I/O
> How should I proceed?
> Tutor maillist - Tutor at python.org
How about pexpect;
Powered by Gentoo GNU/LINUX
More information about the Tutor