Re: telnet read_sb_data
- From: "Arne" <arne.meissner@xxxxxx>
- Date: Fri, 14 Apr 2006 13:59:23 +0200
Thank you for your reply.
Yes I have read the documentation. But I am not sure what is the SB/SE
suboption. Is this a suboption on the remote machine or for Python.
Maybe you could be so kind and explain it to me with a little code example.
Thany you very much!
Arne
"Dennis Lee Bieber" <wlfraed@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:2khu32leqvokk8jnt67nsf4e1f4bnr5deq@xxxxxxxxxx
On Thu, 13 Apr 2006 23:45:06 +0200, "Arne" <arne.meissner@xxxxxx>
declaimed the following in comp.lang.python:
1. What I look for is the option to get only certain parts of the output.Did you read the full documentation? "SB/SE" are "suboption
It
seems to me that the command "read_sb_data" can do this. The
documentation
says, that I will get the data between the SB/SE pair. But I don't know
how
to invoke the SE command in Unix. Even I don't know the SE command.
begin/end", and there is also mention of a "callback". The ONLY other
entry in telnetlib that mentions callbacks is the one for negotiating
telnet options.
read_sb_data( )
Return the data collected between a SB/SE pair (suboption begin/end).
The callback should access these data when it was invoked with a SE
command. This method never blocks.
set_option_negotiation_callback( callback)
Each time a telnet option is read on the input flow, this callback (if
set) is called with the following parameters : callback(telnet socket,
command (DO/DONT/WILL/WONT), option). No other action is done afterwards
by telnetlib.
Using os.stat(path) doesen't work on XP, I am always getting a 0 return
No surprise -- os.stat can only access files mounted on the local
machine. Telnet is remote /terminal/ connection. You'll have to behave
like a terminal... How would you, as a user at a terminal, know when any
command had finished? Probably by seeing a console prompt...
Try
read_until( expected[, timeout])
Read until a given string, expected, is encountered or until timeout
seconds have passed.
When no match is found, return whatever is available instead, possibly
the empty string. Raise EOFError if the connection is closed and no
cooked data is available.
You'll have to know what the prompt string will be...
--
============================================================== <
wlfraed@xxxxxxxxxxxxx | Wulfraed Dennis Lee Bieber KD6MOG <
wulfraed@xxxxxx | Bestiaria Support Staff <
============================================================== <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <
.
- Follow-Ups:
- Re: telnet read_sb_data
- From: Grant Edwards
- Re: telnet read_sb_data
- References:
- telnet read_sb_data
- From: Arne
- telnet read_sb_data
- Prev by Date: GdkColor : the phantom class ?
- Next by Date: %g not the same as %e or %f
- Previous by thread: telnet read_sb_data
- Next by thread: Re: telnet read_sb_data
- Index(es):
Relevant Pages
|