I use telnetlib - Python - to create a telnet client - port 23 - to communicate with an AS/400 server. communication with the telnet command that is no problem, but with telnetlib I do not get any message.
Here is my code:
import getpass
import sys
import telnetlib
HOST = raw_input("HOST : ")
user = raw_input("Enter your remote account: ")
password = getpass.getpass()
try:
tn = telnetlib.Telnet(HOST)
tn.read_until("User..... ")
tn.write(user + "\r")
tn.read_until("Password..... ")
tn.write(password + "\r")
print tn.read_all()
except:
print "Error"
Thanks.