how can I assign a port with code like this? import telnetlib HOST = "localhost" tn = telnetlib.Telnet(HOST) print tn.read_all()