The code i have given is
import telnetlib
HOST="X"
user ="X"
password="X"
en_password="x"
tn=telnetlib.Telnet(HOST)
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
tn=telnetlib.Telnet(HOST)
File "C:\Python27\lib\telnetlib.py", line 209, in __init__
self.open(host, port, timeout)
File "C:\Python27\lib\telnetlib.py", line 225, in open
self.sock = socket.create_connection((host, port), timeout)
File "C:\Python27开发者_JS百科\lib\socket.py", line 567, in create_connection
raise error, msg
error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
This is the error that i am getting while i am trying to connect to the 2600 router . How to remove this error , and connect to the router through a python script?
It's a connection timeout - if you're not having a other networking issues then it's simply that the router is not accepting connections on the default telnet port. Are you sure you can connect via port 23? Can you use a telnet client to connect?
精彩评论