telnetlib question

NightOwl nightowl at uk2.net
Thu Apr 4 15:22:28 EST 2002


Hi,

I would like to be able to read the output of the last command in a telnet
session, without shutting it down.

What I would like to do is

- log in (can do that)
- cat the contents of a couple of files (while the content <> searchstring)
- if the search string is found, echo something.

I managed to log in and cat a file, I managed to do read_all(), however,
that outputs everything AND it seems like I needed to close the connection
first. The doc's are not clear at all at this point. What function do I
need?

Can somebody give me some example code, or the correct function to read the
output of the last command (the last cat in my case)?

I found read_eager(), read_lazy etc, however, the explanation is very
unclear to me!

Thx





More information about the Python-list mailing list