Answers for "python check if ip is up or down"

0

python check if ip is up or down

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())
Posted by: Guest on February-22-2020

Code answers related to "python check if ip is up or down"

Python Answers by Framework

Browse Popular Code Answers by Language