[Tutor] telnet connection question

Alan Gauld alan.gauld at btinternet.com
Fri Jun 10 18:16:26 CEST 2011


"Rayon" <evosweet at hotmail.com> wrote


> Is there any way that I can use python telnetlib to connect to a 
> telnet
> session.
> Send commands and get back data without closing the connection.

Yes, thats what it's for.

> I need the response to be faster and the login process is taking up 
> too much
> time.

Faster than what?
Is it fast if you do it manually?
The library can only talk to the same telnet server at
the far end that your local telnet client talks to. If its
a slow link or server then login (and most other things!)
will be slow. What makes you think its the library at fault?

If you are seeing big differences between manual
and auto login then there might be an issue.
In that case send us the timings for each method
and the code you are using to login. (with login
details obscured if necessary!)

> I was thinking I could use a queue to pass in data
> but I am not sure how i would get it out.

Of course you can use a queue to pass in data,
but that has nothing to do with telnet. As to getting it out.
Out of what? The queue or the telnet session?

We need more detail to be able to give specific answers.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list