Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit ad7ffea

Browse files
authored
Merge pull request #648 from ksaswin/wifi_speed_excepetion_handle
Wifi speed excepetion handle and dependency version update
2 parents d249585 + 64b0ce9 commit ad7ffea

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Scripts/Miscellaneous/Wifi_Speed/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ A simple Python script that uses 'speedtest' module to test the internet bandwid
44
### Prerequisites
55
You will need to install speedtest module.
66
The installation commands are provided in requirements.txt
7+
```bash
8+
pip install -r requirements.txt
9+
```
710

811
### How to run the script
912
First you have to go to the Wifi_Speed directory. Run the following command once you are in project directory
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
speedtest-cli==2.1.2
1+
speedtest-cli==2.1.3

Scripts/Miscellaneous/Wifi_Speed/wifiSpeed.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
# Python module for testing internet bandwidth
44
import speedtest
5+
from sys import exit
56

67
# Creating a instance
7-
s = speedtest.Speedtest()
8+
try:
9+
s = speedtest.Speedtest()
10+
except speedtest.ConfigRetrievalError:
11+
print('Sorry, looks like you are not connected to any network!\nPlease make sure you are connected to the internet.')
12+
exit()
813

914
# Menu
1015
print("Select a valid option from below:\n")

0 commit comments

Comments
 (0)