What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-29 09:50:02
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()) Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5