[Tutor] (no subject)
W X Liu
csmwxl at bath.ac.uk
Thu Sep 9 19:30:33 CEST 2004
Now, I get a feedback on IDLE:
Traceback (most recent call last):
File "C:\Python23\1.py", line 15, in -toplevel-
a.read_until('abb at anarres> ')
File "C:\PYTHON23\lib\telnetlib.py", line 324, in read_until
return self.read_very_lazy()
File "C:\PYTHON23\lib\telnetlib.py", line 400, in read_very_lazy
raise EOFError, 'telnet connection closed'
EOFError: telnet connection closed
So, How can I fix my code by this feedback?
Wenxin
> Hi, everyone,
>
> I writed a program:
>
> import telnetlib
> import sys
>
> a=telnetlib.Telnet(host='mudlib.anarres.org',port='5000')
> a.open(host='mudlib.anarres.org',port='5000') # I don't if I should use it.
> a.read_until('Anarres II login:')
> b=str('user'+chr(10))
> a.write(b+ "\n")
>
> b=str('password'+chr(10))
> a.read_until('password:')
> a.write(b + "\n")
> print a.read_all()
>
> But I always get a result like this:
>
> >>> ================================ RESTART
> ================================
> >>>
>
> in the Python shell(IDLE), and I cannot see any happening on that Telnet
> server?
> Who could teach me about this?
>
> Many thanks
>
> Wenxin Liu
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list