I am new one for python trying to take telnet from my windows7 pc to another windows PC using below script. import telnetlib import os host_ip = "10.22.7.3" user = "user" password = "user" tnet_hndl = telnetlib.Telnet(host_ip) print (tnet_hndl.read_until(b"login: ")) tnet_hndl.write(user.encode('ascii') + b"\r\n") print (tnet_hndl.read_until(b"password: ")) tnet_hndl.write(password.encode('ascii') + b"\r\n") print (tnet_hndl.read_until(b"# ")) tnet_hndl.write(b"" + b"\r\n") print (tnet_hndl.read_until(b"# ")) tnet_hndl.close() I am getting below error ------------------------------------ login: user Timeout expired! Traceback (most recent call last): File "C:/Python27/telnet123.py", line 12, in <module> print (tnet_hndl.read_until(b"# ")) File "C:\Python27\lib\telnetlib.py", line 295, in read_until return self._read_until_with_select(match, timeout) File "C:\Python27\lib\telnetlib.py", line 378, in _read_until_with_select return self.read_very_lazy() File "C:\Python27\lib\telnetlib.py", line 454, in read_very_lazy raise EOFError, 'telnet connection closed' EOFError: telnet connection closed</module>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)