telopt

Telnet option constants exported from the deprecated telnetlib module.

name_command(byte)[source]

Return string description for (maybe) telnet command byte.

Return type:

str

name_commands(cmds, sep=' ')[source]

Return string description for array of (maybe) telnet command bytes.

Return type:

str

name_option(byte)[source]

Return string description for a telnet option byte.

Unlike name_command(), IAC command bytes (DO, DONT, WILL, WONT, etc.) are displayed as repr(byte) rather than their command names when they appear in the option-byte position.

Return type:

str

option_from_name(name)[source]

Return option bytes for a given option name.

Parameters:

name (str) – Option name (e.g., “NAWS”, “TTYPE”)

Return type:

bytes

Returns:

Option bytes

Raises:

KeyError – If name is not a known telnet option