Created
July 17, 2021 18:22
-
-
Save iamramahibrah/e3e34f579e4364ae253b862d0bbed326 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
hostname = "8.8.8.8" | |
for ip in hostname: | |
response = os.system("ping -c1 >/dev/null "+ hostname) | |
if response == 0: | |
print("Connected") | |
else: | |
print("Disconnected") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment