Created
May 16, 2022 13:31
-
-
Save MrGibus/9c9d6994bf435d23786889f18c9ac073 to your computer and use it in GitHub Desktop.
Checks when the NBN have got their shit together. Thanks Coalition.
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
| from time import sleep | |
| import requests | |
| url = "https://www.google.com/" | |
| timeout = 5 | |
| while True: | |
| try: | |
| request = requests.get(url, timeout=timeout) | |
| print("Connected to Internet!") | |
| break | |
| except: | |
| print("No internet Connection") | |
| sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment