📌  相关文章
📜  python 检查 ip 是向上还是向下 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:09.982000             🧑  作者: Mango

代码示例1
import nmap, socket
ip_addr = input('Enter ip or url to check if it is up or down: ')
scanner = nmap.PortScanner()
host = socket.gethostbyname(ip_addr)
scanner.scan(host, '1', '-v')
print("IP Status: ", scanner[host].state())