Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python ping ip address

import os

ip_list = ['8.8.8.8']
for ip in ip_list:
    response = os.popen(f"ping {ip}").read()
    if "Received = 4" in response:
        print(f"UP {ip} Ping Successful")
    else:
        print(f"DOWN {ip} Ping Unsuccessful")
Comment

PREVIOUS NEXT
Code Example
Python :: cv2.imshow 
Python :: remove punctuation from string python 
Python :: pytest --clrear cache 
Python :: flask boiler plate 
Python :: python count words in file 
Python :: python convert number to base 
Python :: pytorch load model 
Python :: rectangle in tkinter 
Python :: print numpy version 
Python :: return maximum of three values in python 
Python :: exception get line number python 
Python :: pandas concat and reset index 
Python :: Could not find a version that satisfies the requirement psycopg2=2.8 (from pgcli) (from versions: 2.7.5, 2.7.6, 2.7.6.1, 2.7.7) 
Python :: fibonacci series python recursion 
Python :: how to receive password using tkinter entry 
Python :: torch summary 
Python :: python sendmessage whatsapp 
Python :: tkfiledialog python 3 example 
Python :: python pi value 
Python :: python turtle line thickness 
Python :: python split first space 
Python :: python color text on windows 
Python :: python read url 
Python :: python temporary directory 
Python :: xarray add coordinate 
Python :: tkinter boilerplate 
Python :: how to send get request python 
Python :: how to create migrations in django 
Python :: get sheet names using pandas 
Python :: base64 decode python 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =