telnetlib.Telnet.read_all()

Telnet.read_all() Read all data until EOF as bytes; block until connection closed.

telnetlib.Telnet.open()

Telnet.open(host, port=0[, timeout]) Connect to a host. The optional second argument is the port number, which defaults to the standard Telnet port (23). The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). Do not try to reopen an already connected instance.

telnetlib.Telnet.mt_interact()

Telnet.mt_interact() Multithreaded version of interact().

telnetlib.Telnet.msg()

Telnet.msg(msg, *args) Print a debug message when the debug level is > 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator.

telnetlib.Telnet.interact()

Telnet.interact() Interaction function, emulates a very dumb Telnet client.

telnetlib.Telnet.get_socket()

Telnet.get_socket() Return the socket object used internally.

telnetlib.Telnet.fileno()

Telnet.fileno() Return the file descriptor of the socket object used internally.

telnetlib.Telnet.expect()

Telnet.expect(list, timeout=None) Read until one from a list of a regular expressions matches. The first argument is a list of regular expressions, either compiled (regex objects) or uncompiled (byte strings). The optional second argument is a timeout, in seconds; the default is to block indefinitely. Return a tuple of three items: the index in the list of the first regular expression that matches; the match object returned; and the bytes read up till and including the match. If end of file

telnetlib.Telnet.close()

Telnet.close() Close the connection.

telnetlib.Telnet

class telnetlib.Telnet(host=None, port=0[, timeout]) Telnet represents a connection to a Telnet server. The instance is initially not connected by default; the open() method must be used to establish a connection. Alternatively, the host name and optional port number can be passed to the constructor too, in which case the connection to the server will be established before the constructor returns. The optional timeout parameter specifies a timeout in seconds for blocking operations like the