Skip to content

Instantly share code, notes, and snippets.

@phase7
Last active July 24, 2020 04:23
Show Gist options
  • Save phase7/948958b487e58a407c22df0cdbb97d1e to your computer and use it in GitHub Desktop.
Save phase7/948958b487e58a407c22df0cdbb97d1e to your computer and use it in GitHub Desktop.
Netcheck with python 3
#!/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