HT telnet interact with auto login?

Chris Liechti cliechti at gmx.net
Sun Jun 16 15:55:15 EDT 2002


K.Rdt at TU-Berlin.DE (Klaus Reinhardt) wrote in 
news:3d0cd198.17917980 at news.zrz.tu-berlin.de:
> I want to combine:
> 
> import getpass
> import sys
> import telnetlib
> 
> HOST = "...de"
> tn = telnetlib.Telnet(HOST)
> 
> user = '...'
> password = '...'
> 
> 1.)
> tn.interact()     # this is working but with manually ..
> 2.)
> tn.read_until("login: ")     # this seams to work
>                # but without connection
> tn.write(user + "\n")
> if password:
>     tn.read_until("Password: ")
>     tn.write(password + "\n")

i don't understand your question... but often a '\r\n' is required
as end of line. maybe this helps :-)

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list