Last active
December 16, 2015 16:49
-
-
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.
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
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...') |
Thanks, is it similarly to .NET languages?
It has similarities to all programming languages but it is also very much its own language.
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
I am self taught but I have heard that this is a good resource.
http://learnpythonthehardway.org/
If you are already a programmer I would suggest checking out raymond hettinger's videos and david beazley's videos on youtube.
Greets from USA :)