diff --git a/Scripts/Miscellaneous/Wifi_Speed/README.md b/Scripts/Miscellaneous/Wifi_Speed/README.md index bd12bbef5..1360d6c36 100644 --- a/Scripts/Miscellaneous/Wifi_Speed/README.md +++ b/Scripts/Miscellaneous/Wifi_Speed/README.md @@ -4,6 +4,9 @@ A simple Python script that uses 'speedtest' module to test the internet bandwid ### Prerequisites You will need to install speedtest module. The installation commands are provided in requirements.txt +```bash + pip install -r requirements.txt +``` ### How to run the script First you have to go to the Wifi_Speed directory. Run the following command once you are in project directory diff --git a/Scripts/Miscellaneous/Wifi_Speed/requirements.txt b/Scripts/Miscellaneous/Wifi_Speed/requirements.txt index 5577283ae..09cbe4da2 100644 --- a/Scripts/Miscellaneous/Wifi_Speed/requirements.txt +++ b/Scripts/Miscellaneous/Wifi_Speed/requirements.txt @@ -1 +1 @@ -speedtest-cli==2.1.2 +speedtest-cli==2.1.3 diff --git a/Scripts/Miscellaneous/Wifi_Speed/wifiSpeed.py b/Scripts/Miscellaneous/Wifi_Speed/wifiSpeed.py index 7a836ae11..c4509b118 100644 --- a/Scripts/Miscellaneous/Wifi_Speed/wifiSpeed.py +++ b/Scripts/Miscellaneous/Wifi_Speed/wifiSpeed.py @@ -2,9 +2,14 @@ # Python module for testing internet bandwidth import speedtest +from sys import exit # Creating a instance -s = speedtest.Speedtest() +try: + s = speedtest.Speedtest() +except speedtest.ConfigRetrievalError: + print('Sorry, looks like you are not connected to any network!\nPlease make sure you are connected to the internet.') + exit() # Menu print("Select a valid option from below:\n")