Created
September 20, 2012 23:31
-
-
Save nibalizer/3758958 to your computer and use it in GitHub Desktop.
myping the thing to ping
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 python | |
| import subprocess, commands | |
| while True: | |
| foo = commands.getoutput('ping -c 1 marine.cat.pdx.edu | grep "ms" | cut -d "=" -f 4') | |
| # foo = sub.Popen("ping -c 1 marine.cat.pdx.edu") | |
| # print foo | |
| foo = foo.split(" ")[0] | |
| #print "#"*int(float(foo)*100) | |
| try: | |
| print float(foo) | |
| except ValueError: | |
| print foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment