Skip to content

Instantly share code, notes, and snippets.

@bahostetterlewis
Last active December 16, 2015 16:49
Show Gist options
  • Save bahostetterlewis/5465883 to your computer and use it in GitHub Desktop.
Save bahostetterlewis/5465883 to your computer and use it in GitHub Desktop.
My internet sucks and randomly cuts out. This lets me know when I'm connected again. simple and sweet so I don't have to ever type ping again.
import winsound
from subprocess import call, DEVNULL
print('Begin Ping Alert')
while call(["ping", "google.com"], stdout=DEVNULL, stderr=DEVNULL) != 0:
print('No net yet :(')
print('Web Back!!!')
winsound.PlaySound(r"C:\Windows\Media\tada.wav", winsound.SND_FILENAME)
print('End Ping Alert')
input('Press enter to exit...')
@jabbalaci
Copy link

See http://stackoverflow.com/tags/python/info too. At the bottom you find a nice collection of learning materials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment