Last active
July 24, 2020 04:23
-
-
Save phase7/948958b487e58a407c22df0cdbb97d1e to your computer and use it in GitHub Desktop.
Netcheck with python 3
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
#!/usr/bin/env python3 | |
from subprocess import run | |
from time import sleep | |
def main(): | |
for i in range(200): | |
print ("try", i+1) | |
run(["ping -c 10 8.8.8.8"], shell=True) | |
sleep(4) | |
if __name__ == "__main__": | |
try: | |
main() | |
except KeyboardInterrupt: | |
print("\nExitting...") | |
quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment