Automating a telnet session with an echo to stdout

Samuel newsgroups at debain.org
Mon Jun 4 21:46:59 CEST 2007


On Sat, 02 Jun 2007 17:41:01 +0000, Samuel wrote:

> I am trying to automate a telnet session (currently using Python's
> telnetlib) and would like to echo any response of the remote host to
> stdout, as soon as it arrives on telnetlib's open TCP socket.

For the records: Because I did not find any other solution, I modified 
telnetlib to provide a callback that let's me see what is going on. The
patch is here:

http://sourceforge.net/tracker/index.php?func=detail&aid=1730959&group_id=5470&atid=305470

-Samuel



More information about the Python-list mailing list