python telnet script for openvms host

Ennis Rosamond ennisr at
Tue Dec 26 13:50:48 EST 2000

In article <kuito7rrg7.fsf at>,
  Erno Kuusela <erno-news at> wrote:
> Ennis Rosamond <ennisr at> writes:
> | tn.read_until('[c')    #last char of session hearder
> | tn.write('$ dir\r')
> | #following this, I receive back the sequence:
> | #recv '\377\373\001'
> | #IAC WILL 251
> | #recv '\377\373\003'
> | #IAC WILL 251
> | #recv '\003\\\033Z'
> | #
> | #which I don't know how to interpret.
> that looks like telnet option negotiation, telnetlib should
> take care of all that automaticalyl for you. i suspect
> the above is just some debug output from telnetlib.
> are you sure you are seeing it after your last .write call,
> and not at the start of the telnet connection?
>   -- erno

Thanks for the quick reply Erno.

You are correct.  The sequence I listed is the debug output.  I am
seeing it after the "tn.write('$ dir\r')" call.  It may not be relevant
if the host simply isn't ready to receive the write call.

I tried using "tn.read_until('$ ')" in the previous read instead of
"tn.read_until('[c')", but that sequence is never found.  That is why I
think the host is not sending back a prompt.  But then I am pretty naive
about this whole topic.

Sent via

More information about the Python-list mailing list