Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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())
Comment

PREVIOUS NEXT
Code Example
Python :: loop through list of lists jinja 
Python :: decision tree classifier python code for visualization 
Python :: how to configure a button in python tkinter 
Python :: from_bytes python 
Python :: python animation 
Python :: python get index of substring in liast 
Python :: check space in string python 
Python :: string equals python 
Python :: exit code python 
Python :: split coumn of df into multiple dynamic columns 
Python :: numpy python 3.10 
Python :: how to combine two lists in python 
Python :: python keyboard input 
Python :: How to Connect Google Colab to a Local Jupyter Runtime 
Python :: pygame scroll event 
Python :: how to print 2 list in python as table 
Python :: count element in set python 
Python :: beautifulsoup find text inside tag 
Python :: how to change entry in a row based on another columns entry python 
Python :: python create a set of class 
Python :: python portfolio projects 
Python :: python single line comment 
Python :: how to get input from user in pyqt5 
Python :: yaml validator python 
Python :: django model inheritance 
Python :: pandas check if column is object type 
Python :: python button tkinter change color 
Python :: how to append substring to string in specific position in python 
Python :: python close a socket 
Python :: character in python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =