I just hit upon something that seems to work...

##########################
import telnetlib
from select import select

tn = telnetlib.Telnet('192.168.100.11')
sock = tn.get_socket()

tn.read_until('login: ', 5)
select([sock], [], [], 5)
tn.write('user\n')

tn.read_until('Password: ', 5)
select([sock], [], [], 5)
tn.write('password\n')

tn.read_until('bash-2.05$ ', 5)
tn.write('ls\n')
select([sock], [], [], 5)
print tn.read_very_eager()
##########################

If anyone sees any potential problems with this, I would appreciate it.
 TIA

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to