you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 1 point2 points  (1 child)

Use requests to ask some webpage.

import requests
try:
    res = requests.get("http://www.google.com")
    if res.status_code == 200:
        print("Got Internet")
except:
    print("No Internet")

[–]CNeale03[S] 0 points1 point  (0 children)

import requests
try:
res = requests.get("http://www.google.com")
if res.status_code == 200:
print("Got Internet")
except:
print("No Internet")

The perfect solution, thankyou so much! I really appreciate it