想用python2 telnetlib 模块实现windows telnet linux 固定端口telnet timeout的监控,但是用下面的代码的时候,不知道怎样对timeout的情况进一步处理。
代码:
def do_telnet(Host, username, password, finish, commands):
import telnetlib
'''''Telnet远程登录:Windows客户端连接Linux服务器'''
# 连接Telnet服务器
tn = telnetlib.Telnet(Host, port=23, timeout=10)
tn.set_debuglevel(2)
请哪位大神,这段代码后面怎样处理timeout的情况啊
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
闭关修行中......