This repository was archived by the owner on Dec 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +51
-0
lines changed
Scripts/Miscellaneous/Wifi_Speed Expand file tree Collapse file tree 4 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Python script that provides the download and upload speed of your Wifi
2
+ A simple Python script that uses 'speedtest' module to test the internet bandwidth of your connection.
3
+
4
+ ### Prerequisites
5
+ You will need to install speedtest module.
6
+ The installation commands are provided in requirements.txt
7
+
8
+ ### How to run the script
9
+ First you have to go to the Wifi_Speed directory. Run the following command once you are in project directory
10
+
11
+ ``` cd Scripts/Miscellaneous/Wifi_Speed ```
12
+
13
+ For Python 3: ``` python3 wifiSpeed.py ```
14
+ For Python 2: ``` python wifiSpeed.py ```
15
+
16
+ ### Screenshot/GIF showing the sample use of the script
17
+ ![ Screenshot] ( Screenshot.png )
18
+
19
+ ## * Author Name*
20
+ Adesh Choudhar
Original file line number Diff line number Diff line change
1
+ speedtest-cli == 2.1.2
Original file line number Diff line number Diff line change
1
+ # Python script that provides the download and upload speed of your Wifi.
2
+
3
+ # Python module for testing internet bandwidth
4
+ import speedtest
5
+
6
+ # Creating a instance
7
+ s = speedtest .Speedtest ()
8
+
9
+ # Menu
10
+ print ("Select a valid option from below:\n " )
11
+ print ("1. Download" )
12
+ print ("2. Upload" )
13
+ print ("3. Exit\n " )
14
+
15
+ # Run until valid option is selected
16
+ while True :
17
+ # Getting options from user
18
+ option = int (input ("Enter Option: " ))
19
+
20
+ if option == 1 :
21
+ download = s .download () / 1000
22
+ print (f"Download Speed : %.2f kb/s\n " % download )
23
+ elif option == 2 :
24
+ upload = s .upload () / 1000
25
+ print (f"Upload Speed : %.2f kb/s\n " % upload )
26
+ elif option == 3 :
27
+ print ("\n Exiting Successfully..." )
28
+ break
29
+ else :
30
+ print ("INVALID OPTION SELECTED! Re-" , end = "" )
You can’t perform that action at this time.
0 commit comments