Extracting data from telnet session ?

Mike Johnson afp_randjohnson at yahoo.com
Sun Feb 24 05:34:51 EST 2002


Henning Sauer <hsauer at marnie.teuto.de> writes:
> 
> 
> What I would like to know is how can I extract the information from
> this data stream ?  Is this really the data from the router or might
> it be debug information ? When I'm not setting the set_debuglevel
> I'm getting no output.

That suggests that you haven't logged in yet.

Try logging into the machine and running "who" to see if your app
really did log into the server. My guess is that the "password:"
prompt is off, possibly you will need "Password: ". Otherwise, your
app may wait forever, scanning for the wrong prompt.

Also, you will need to use "\r" instead of "\n" for newline
characters.

I'm not sure if it's still needed (somebody here can correct me), but
you used to need to write:

mytelnet.write("\255\253\003") #this is the "fix" command added

after logging in.

For some odd reason I don't remember. :-)

- Mike Johnson




More information about the Python-list mailing list