How can I check the status of a remote PC using telnet
from a python script?
If it has to be telnet, you can use the built-in telnetlib
:
from socketlib import timeout
from telnetlib import Telnet
try:
Telnet("example.com", 23, 5) # Timeout duration is 5 seconds
print("Connected")
except timeout:
print("Timed out")