Python telnetlib Module
Example
Demonstrate telnet module:
import telnetlib
# telnetlib provides a Telnet client
print('Module for Telnet protocol')
print('Use Telnet() to create connections')
Try it Yourself »
Definition and Usage
The telnetlib module provides a Telnet client implementation for network communication.
Use it to connect to Telnet servers, automate remote administration, or interact with legacy network services.
Note: This module is deprecated since Python 3.11 and will be removed in Python 3.13.
Members
Member | Description |
---|---|
Telnet | Class for Telnet client connections. |
Telnet.close() | Close the connection. |
Telnet.open() | Connect to a host. |
Telnet.read_all() | Read all data until EOF. |
Telnet.read_until() | Read until a given byte string is encountered. |
Telnet.write() | Write a byte string to the socket. |