Created
March 19, 2018 12:38
-
-
Save aweher/fdaa91abc958aaae54086a9ae5b30a1d to your computer and use it in GitHub Desktop.
Ping in python 3 without output or using subprocess
This file contains 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
def is_alive(host): | |
ret = os.system('ping -c 3 -t 3 -n -q {} > /dev/null'.format(host)) | |
if ret == 0: | |
return True | |
return False |
i3130002
commented
Oct 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment