Sending Through ^] Through telnetlib

Discussion in 'Python' started by John Abel, Jan 23, 2004.

  1. John Abel

    John Abel Guest

    I have written a script that makes a telnet connection, runs various
    commands, and returns the output. That was the easy bit :) However, to
    close the session, I need to send ^] followed by quit. I've tried
    sending chr(29), which is the ascii equivalent, but that doesn't seem to
    work. Is there something I'm missing?

    Any pointers would be much appreciated.

    Thanks

    J
     
    John Abel, Jan 23, 2004
    #1
    1. Advertising

  2. "John Abel" <> wrote in message
    news:...

    > I have written a script that makes a telnet connection, runs various
    > commands, and returns the output. That was the easy bit :) However, to
    > close the session, I need to send ^] followed by quit.


    Are you sure that just calling close() isn't what you want?
    It would be unusual to send ^]quit on the wire.
     
    Richard Brodie, Jan 23, 2004
    #2
    1. Advertising

  3. John Abel

    jr Guest

    Try sending: '\x1d'

    HTH
    -jr

    "John Abel" <> wrote in message news:...
    > I have written a script that makes a telnet connection, runs various
    > commands, and returns the output. That was the easy bit :) However, to
    > close the session, I need to send ^] followed by quit. I've tried
    > sending chr(29), which is the ascii equivalent, but that doesn't seem to
    > work. Is there something I'm missing?
    >
    > Any pointers would be much appreciated.
    >
    > Thanks
    >
    > J
    >
     
    jr, Jan 23, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    2
    Views:
    1,921
    Francis Avila
    Nov 12, 2003
  2. =?gb2312?B?1cXWvsP3?=

    quest about telnetlib

    =?gb2312?B?1cXWvsP3?=, Nov 13, 2003, in forum: Python
    Replies:
    1
    Views:
    300
    GrayGeek
    Nov 13, 2003
  3. Mahrt, Dallas

    RE: Sending Through ^] Through telnetlib

    Mahrt, Dallas, Jan 23, 2004, in forum: Python
    Replies:
    0
    Views:
    543
    Mahrt, Dallas
    Jan 23, 2004
  4. Stephen Ferg

    Need help with telnetlib flakiness

    Stephen Ferg, Feb 4, 2004, in forum: Python
    Replies:
    1
    Views:
    366
    Stephen Ferg
    Feb 6, 2004
  5. Mike Monaghan

    telnetlib close not closing sockets

    Mike Monaghan, Sep 22, 2004, in forum: Python
    Replies:
    4
    Views:
    1,324
    Mike Monaghan
    Oct 7, 2004
Loading...

Share This Page