telnetlib.Telnet.write()

Telnet.write(buffer) Write a byte string to the socket, doubling any IAC characters. This can block if the connection is blocked. May raise OSError if the connection is closed. Changed in version 3.3: This method used to raise socket.error, which is now an alias of OSError.

telnetlib.Telnet.set_option_negotiation_callback()

Telnet.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.

telnetlib.Telnet.set_debuglevel()

Telnet.set_debuglevel(debuglevel) Set the debug level. The higher the value of debuglevel, the more debug output you get (on sys.stdout).

telnetlib.Telnet.read_very_lazy()

Telnet.read_very_lazy() Return any data available in the cooked queue (very lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. This method never blocks.

telnetlib.Telnet.read_very_eager()

Telnet.read_very_eager() Read everything that can be without blocking in I/O (eager). Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Do not block unless in the midst of an IAC sequence.

telnetlib.Telnet.read_until()

Telnet.read_until(expected, timeout=None) Read until a given byte string, expected, is encountered or until timeout seconds have passed. When no match is found, return whatever is available instead, possibly empty bytes. Raise EOFError if the connection is closed and no cooked data is available.

telnetlib.Telnet.read_some()

Telnet.read_some() Read at least one byte of cooked data unless EOF is hit. Return b'' if EOF is hit. Block if no data is immediately available.

telnetlib.Telnet.read_sb_data()

Telnet.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.

telnetlib.Telnet.read_lazy()

Telnet.read_lazy() Process and return data already in the queues (lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. Do not block unless in the midst of an IAC sequence.

telnetlib.Telnet.read_eager()

Telnet.read_eager() Read readily available data. Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Do not block unless in the midst of an IAC sequence.