using telnetlib

Phoe6 orsenthil at gmail.com
Wed Feb 28 04:23:02 EST 2007


Hi All,
I am trying to use the telnetlib module.

Manually when I do
telnet 172.31.128.244
I get:

Login: (I type root)
Password: ( I type Password)
And it enters to the Telnet Session:
[root]#

Now, I am trying to use telnetlib module
>>> import telnetlib
>>> tn = telnetlib.Telnet("172.31.128.244")
>>> tn.read_until("Login: ")
'\r\nLogin: '
>>> tn.write("root\n:")
>>>tn.read_until("Password: ")

Cursor stays over here forever!. Delays are not working. I tried all
the codes mentioned n c.l.p, but i have not yet been able to get
telnetlib working.
Any suggestions as how to troubleshoot and resolve this issue?

Thanks,
Senthil




More information about the Python-list mailing list