Telnet connection

Riss Nicolas alien275 at libertysurf.fr
Wed Feb 27 18:34:02 CET 2002


I jave used it but when y tried to connect it makes an error:
   File "c:\test.py", line 9, in ?
    tn = telnetlib.Telnet("192.168.0.9",32)
  File "C:\PROGRA~1\python22\lib\telnetlib.py", line 190, in __init__
    self.open(host, port)
  File "C:\PROGRA~1\python22\lib\telnetlib.py", line 219, in open
    raise socket.error, msg
socket.error: (10061, 'Connection refused')

Programm:

import getpass
import sys
import telnetlib
password = getpass.getpass()
tn = telnetlib.Telnet("192.168.0.9",32)
tn.read_until("Administrator Password : ")
tn.write(password + "\n")
tn.write("session\n")


Where is the mistake ?

Thanks
"Emile van Sebille" <emile at fenx.com> a écrit dans le message de news:
a5iuq9$7701i$1 at ID-11957.news.dfncis.de...
>
> "Riss Nicolas"
> > Hello,
> > I must do a program who can connect with telnet. But I don't know how
> to
> > make a such connection with python, can somebody help me please.
> >
>
> Start with telnetlib
>
> --
>
> Emile van Sebille
> emile at fenx.com
>
> ---------
>





More information about the Python-list mailing list