python检测端口是否已开启服务 使用 库telnetlib,可以检测端口是否开放 代码示例如下: """ @contact: 微信 1257309054 @file: test.py @time: 2022/12/15 15:39 @author: LDC """ import telnetlib def telnet(host, port): """ 检测端口是否开启服务 :return: """