Skip to content

Commit 386fc11

Browse files
committed
How to check the speed the internet - Python
How to check the speed the internet - Python
1 parent e1652c4 commit 386fc11

9 files changed

+82
-0
lines changed

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/python_Project.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import requests
2+
from requests.exceptions import ConnectionError
3+
4+
5+
def internet_connection_test():
6+
url = 'https://www.google.com/'
7+
print(f'Attempting to connect to {url} to determine internet connection status.')
8+
9+
try:
10+
print(url)
11+
resp = requests.get(url, timeout=10)
12+
resp.text
13+
resp.status_code
14+
print(f'Connection to {url} was successful.')
15+
return True
16+
except ConnectionError as e:
17+
requests.ConnectionError
18+
print(f'Failed to connect to {url}.')
19+
return False
20+
except:
21+
print(f'Failed with unparsed reason.')
22+
return False
23+
24+
25+
internet_connection_test()
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import speedtest
2+
wifi = speedtest.Speedtest()
3+
print("Wifi Download Speed is ", wifi.download()/1024/1024)
4+
print("Wifi Upload Speed is ", wifi.upload()/1024/1024)

import.library.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip install speedtest-cli

0 commit comments

Comments
 (0)